mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 09:21:32 +00:00
feat: use sass-embedded to compile if available
this requires locally linking your globally-installed sass-embedded package, either through yarn link or whichever else we are not requiring it explicitly because supposedly the binaries are not widely available through all platforms e.g. yarn global add sass-embedded cd ~/.config/yarn/global/node_modules/sass-embedded yarn link cd /path/to/this/project yarn link sass-embedded actually symlinking via generic ln -s would do too, but the method above allows you to yarn link it into other projects, while maintaining the package itself via yarn global (to update, etc.)
This commit is contained in:
parent
832ce2df5c
commit
80696c80d7
@ -14,6 +14,11 @@ const sassCompiler = require('sass')
|
||||
const sourcemaps = require('gulp-sourcemaps')
|
||||
const stylelint = require('@ronilaukkarinen/gulp-stylelint')
|
||||
const terser = require('gulp-terser')
|
||||
let sassEmbeddedCompiler
|
||||
try {
|
||||
sassEmbeddedCompiler = require('sass-embedded')
|
||||
console.log('Using "sass-embedded" package to compile sass\u2026')
|
||||
} catch (_) {}
|
||||
|
||||
// Put built files for development on a Git-ignored directory.
|
||||
// This will prevent IDE's Git from unnecessarily
|
||||
@ -26,7 +31,7 @@ const postcssPlugins = [
|
||||
postcssPresetEnv()
|
||||
]
|
||||
|
||||
sass.compiler = sassCompiler
|
||||
sass.compiler = sassEmbeddedCompiler || sassCompiler
|
||||
|
||||
// Minify on production
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
|
Loading…
Reference in New Issue
Block a user