Skip to content

Commit

Permalink
fix: TypeError: Cannot read property 'watchFileSystem' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
吴浩麟 committed Jul 14, 2018
1 parent 2f40c1e commit b77e379
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/WebPlugin.js
Expand Up @@ -86,15 +86,14 @@ class WebPlugin {
// user may use Default template
if (typeof options.template === 'string') {
// watch for file changed event
compiler.hooks.watchRun.tap('WebPlugin', (watching, done) => {
compiler.hooks.watchRun.tap('WebPlugin', (watching) => {
// 发生变化的文件列表
const changedTimes = watching.compiler.watchFileSystem.watcher.mtimes;
const changedTimes = watching.watchFileSystem.watcher.mtimes;
// 如果 HTML 模版文件发生了变化就重新编译模版文件
if (changedTimes[options.template] !== undefined) {
// html template file has changed, re build this.htmlDocument
this.buildHtmlDocument();
}
done();
});

// add html template file to file dependencies after compile, to let webpack watch html template file change and emit watch-run event
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "web-webpack-plugin",
"version": "4.0.0",
"version": "4.0.1",
"description": "web plugin for webpack, alternatives for html-webpack-plugin, use HTML as entry",
"keywords": [
"webpack",
Expand Down

0 comments on commit b77e379

Please sign in to comment.