Skip to content

Commit

Permalink
fix(build): use os specific path separator in npm run build.watch (#4958
Browse files Browse the repository at this point in the history
)

The run build.watch task was not working in windows as it relied on the
task separator being '/'. Change it to use the OS specific separator
  • Loading branch information
mamohr authored and valorkin committed Feb 6, 2019
1 parent 08e61d3 commit 5e4183e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/build-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const buildPkgJson = require('ngm-cli/tasks/npm/build-pkg-json.task');
const src = 'src';
const dist = 'dist';
const common = 'common';
const path = require('path');

let flags = {};

Expand Down Expand Up @@ -57,7 +58,7 @@ if (flags.watch) {
ignored: /(^|[\/\\])\../
})
.on('change', (event) => {
let moduleName = event.replace(/src\/(.*)\/.*/i, '$1');
let moduleName = event.replace(new RegExp(`src\\${path.sep}(.*)\\${path.sep}(.*)`,'i'), '$1');
buildModules([moduleName])
});
}
Expand Down

0 comments on commit 5e4183e

Please sign in to comment.