Skip to content

Commit

Permalink
fix: compatibility on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
soda-x committed Apr 3, 2018
1 parent a722c65 commit f45366a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import uniq from 'lodash.uniq';
import isGlob from 'is-glob';
import glob from 'glob';

import { resolve } from 'path';

function getFileAndContextDeps(compilation, files, dirs, cwd) {
const { fileDependencies, contextDependencies } = compilation;
const isWebpack4 = compilation.hooks;
Expand Down Expand Up @@ -58,13 +60,11 @@ export default class ExtraWatchWebpackPlugin {
} = getFileAndContextDeps(compilation, files, dirs, cwd);
if (files.length > 0) {
fileDependencies.forEach((file) => {
console.log('file added to ===>', file);
compilation.fileDependencies.add(file);
compilation.fileDependencies.add(resolve(file));
});
}
if (dirs.length > 0) {
contextDependencies.forEach((context) => {
console.log('context added to ===>', context);
compilation.contextDependencies.add(context);
});
}
Expand Down

0 comments on commit f45366a

Please sign in to comment.