Skip to content

Commit fe713b7

Browse files
authored
Merge pull request tompascall#1 from dainyl/master
Fixed webpack watch
2 parents 08ec36a + e55d1ca commit fe713b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const operator = {
3636

3737
getVarData (modulePath, webpackContext) {
3838
return modulePath.reduce( (accumulator, currentPath) => {
39-
const moduleData = (currentPath.methodName)? require(path.join(webpackContext.context, currentPath.path))[currentPath.methodName] : require(path.join(webpackContext.context, currentPath.path));
39+
const modulePath = path.join(webpackContext.context, currentPath.path);
40+
delete require.cache[require.resolve(modulePath)];
41+
const moduleData = (currentPath.methodName)? require(modulePath)[currentPath.methodName] : require(modulePath);
42+
webpackContext.addDependency(modulePath);
4043
return Object.assign(accumulator, moduleData);
4144
}, {});
4245
},

0 commit comments

Comments
 (0)