Skip to content

Commit

Permalink
Merge branch 'hotfix/1.5.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Igloczek committed Aug 7, 2017
2 parents 09046c6 + a9e1901 commit c327b65
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Check `config/themes.json.sample` to get samples.
- `modules` - list of modules witch you want to map inside your theme
- `ignore` - array of ignore patterns

## `watcher.json` structure
Check `config/watcher.json.sample` to get samples.
- `usePolling` - set this to `true` to successfully watch files over a network (i.e. Docker or Vagrant) or when your watcher dosen't work well. Warining, enabling this option may lead to high CPU utilization! [chokidar docs](https://github.com/paulmillr/chokidar#performance)

## Optional configurations for 3rd party plugins
You will find sample config files for theses plugins in `vendor/snowdog/frontools/config` directory.
* Create [browserSync](https://www.browsersync.io/) configuration
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "snowdog/frontools",
"description": "Set of front-end tools for Magento 2, based on Gulp.js",
"version": "1.5.5",
"version": "1.5.6",
"license": "MIT",
"type": "magento2-component"
}
3 changes: 3 additions & 0 deletions config/watcher.json.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"usePolling": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magento2-frontools",
"version": "1.5.5",
"version": "1.5.6",
"author": {
"name": "Bartek Igielski",
"email": "[email protected]"
Expand Down
20 changes: 11 additions & 9 deletions task/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module.exports = function(resolve) { // eslint-disable-line func-names
config = this.opts.configs,
themes = plugins.getThemes();

config.watcher = require('../helper/config-loader')('watcher.json', plugins, config);

plugins.path = require('path');
plugins.helper = {};
plugins.helper.babel = require('../helper/babel');
Expand Down Expand Up @@ -33,16 +35,16 @@ module.exports = function(resolve) { // eslint-disable-line func-names
});
}

// Chokidar watcher config
const watcherConfig = { // eslint-disable-line one-var
ignoreInitial: true,
usePolling: config.watcher.usePolling
};

// Initialize watchers
const tempWatcher = plugins.chokidar.watch(themeTempSrc, { // eslint-disable-line one-var
ignoreInitial: true
}),
srcWatcher = plugins.chokidar.watch(themeSrc, {
ignoreInitial: true
}),
destWatcher = plugins.chokidar.watch(themeDest, {
ignoreInitial: true
});
const tempWatcher = plugins.chokidar.watch(themeTempSrc, watcherConfig), // eslint-disable-line one-var
srcWatcher = plugins.chokidar.watch(themeSrc, watcherConfig),
destWatcher = plugins.chokidar.watch(themeDest, watcherConfig);

let reinitTimeout = false,
sassDependecyTree = {};
Expand Down

0 comments on commit c327b65

Please sign in to comment.