Skip to content

Commit

Permalink
Fix JS compiling in watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jun 24, 2017
1 parent 145a45e commit e9a80cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/watch.js
@@ -1,7 +1,7 @@
const path = require('path');
const chokidar = require('chokidar');
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 getJS = require('./js');
const getSass = require('./sass');
Expand Down Expand Up @@ -47,8 +47,8 @@ function getWatch() {
let watcher = chokidar.watch(source, { cwd: ROOT })
.on('change', async (path) => {
try {
if (multimatch(path, jsGlob).length && !multimatch(path, jsGlobIgnore).length) {
onSuccess(await getJS(path, { ignore: jsGlobIgnore }, signatures));
if (multimatch(path, jsFiles).length && !multimatch(path, ignoreMask).length) {
onSuccess(await getJS(path, { ignore: ignoreMask }, signatures));
} else if (multimatch(path, 'scss/*.scss').length) {
onSuccess(await getSass(path, {}, signatures));
} else if (multimatch(path, copyDirs.map(d => `${d}/**`)).length) {
Expand Down

0 comments on commit e9a80cb

Please sign in to comment.