Fix JS compiling in watch mode
This commit is contained in:
parent
145a45e8e1
commit
e9a80cb530
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const chokidar = require('chokidar');
|
const chokidar = require('chokidar');
|
||||||
const multimatch = require('multimatch');
|
const multimatch = require('multimatch');
|
||||||
const { dirs, jsGlob, jsGlobIgnore, copyDirs, symlinkFiles } = require('./config');
|
const { dirs, jsFiles, ignoreMask, copyDirs, symlinkFiles } = require('./config');
|
||||||
const { onSuccess, onError, getSignatures, writeSignatures, cleanUp, formatDirsForMatcher } = require('./utils');
|
const { onSuccess, onError, getSignatures, writeSignatures, cleanUp, formatDirsForMatcher } = require('./utils');
|
||||||
const getJS = require('./js');
|
const getJS = require('./js');
|
||||||
const getSass = require('./sass');
|
const getSass = require('./sass');
|
||||||
|
@ -47,8 +47,8 @@ function getWatch() {
|
||||||
let watcher = chokidar.watch(source, { cwd: ROOT })
|
let watcher = chokidar.watch(source, { cwd: ROOT })
|
||||||
.on('change', async (path) => {
|
.on('change', async (path) => {
|
||||||
try {
|
try {
|
||||||
if (multimatch(path, jsGlob).length && !multimatch(path, jsGlobIgnore).length) {
|
if (multimatch(path, jsFiles).length && !multimatch(path, ignoreMask).length) {
|
||||||
onSuccess(await getJS(path, { ignore: jsGlobIgnore }, signatures));
|
onSuccess(await getJS(path, { ignore: ignoreMask }, signatures));
|
||||||
} else if (multimatch(path, 'scss/*.scss').length) {
|
} else if (multimatch(path, 'scss/*.scss').length) {
|
||||||
onSuccess(await getSass(path, {}, signatures));
|
onSuccess(await getSass(path, {}, signatures));
|
||||||
} else if (multimatch(path, copyDirs.map(d => `${d}/**`)).length) {
|
} else if (multimatch(path, copyDirs.map(d => `${d}/**`)).length) {
|
||||||
|
|
Loading…
Reference in a new issue