Skip to content

Commit

Permalink
fix: avoid stopping watching after detecting syntax error in route me…
Browse files Browse the repository at this point in the history
…ta (#61)

* fix: do not stop watching after detecting syntax error in route meta

* chore: bump vue-route-generator
  • Loading branch information
ktsn committed Jan 11, 2020
1 parent de2a672 commit e14ea39
Show file tree
Hide file tree
Showing 5 changed files with 600 additions and 16 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@
"webpack": "^4.39.2"
},
"dependencies": {
"vue-route-generator": "^0.4.1"
"vue-route-generator": "^0.4.3"
}
}
9 changes: 7 additions & 2 deletions src/webpack-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ class VueAutoRoutingPlugin {
fs.writeFileSync(to, code)
}

compiler.hooks.run.tap(pluginName, generate)
compiler.hooks.watchRun.tap(pluginName, generate)
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
try {
generate()
} catch (error) {
compilation.errors.push(error)
}
})
}
}

Expand Down

0 comments on commit e14ea39

Please sign in to comment.