Skip to content

Commit

Permalink
Configurable watch directories with eve-watchify on package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
SonoIo committed Nov 29, 2020
1 parent 447cc4b commit b5578de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
9 changes: 6 additions & 3 deletions lib/scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) {
Expand All @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit b5578de

Please sign in to comment.