diff --git a/RELEASE.md b/RELEASE.md index 91fd28e..0c16e58 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,9 @@ # Release notes +## 3.1.2 +- Configure SCSS watch directory through `eve-watchify.directories`. If defined as an array of directory in your project package.json, +it will start watching it for changes and rebuild the CSS accordingly. + ## 3.1.1 - Added parameter `--exorcist` to `eve test` command. diff --git a/lib/scss.js b/lib/scss.js index e8f2e96..d03d5f3 100644 --- a/lib/scss.js +++ b/lib/scss.js @@ -17,7 +17,8 @@ module.exports = function (mode, unit, watcher, options, done) { var mapFile = path.resolve(path.join('build', 'assets', 'css', 'style.css.map')); _.defaults(watchifyConfig, { - delay: 500 + delay: 500, + directories: [] }); if ( mode == 'test' ) { @@ -27,8 +28,10 @@ module.exports = function (mode, unit, watcher, options, done) { outFile = path.resolve(path.join('dist', namePkg+'.css')); } - if ( watcher ) - watch({ dirsAndFiles: ['styles'] }, _.debounce( buildScss, watchifyConfig.delay ) ); + if ( watcher ) { + const dirs = ['styles'].concat(watchifyConfig.directories); + watch({ dirsAndFiles: dirs }, _.debounce( buildScss, watchifyConfig.delay ) ); + } buildScss(); diff --git a/package.json b/package.json index f17969c..f16d044 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-eve", - "version": "3.1.1", + "version": "3.1.2", "description": "Eve command line tools for browserify projects", "bin": { "eve": "./lib/eve.js"