Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ class VueLoaderPlugin {
if (compiler.hooks) {
// webpack 4
compiler.hooks.compilation.tap(id, compilation => {
compilation.hooks.normalModuleLoader.tap(id, loaderContext => {
let { normalModuleLoader } = compilation.hooks;
if (!normalModuleLoader) {
// webpack 5
normalModuleLoader = require('webpack/lib/NormalModule').getCompilationHooks(compilation).loader
}
normalModuleLoader.tap(id, loaderContext => {
loaderContext[NS] = true
})
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"peerDependencies": {
"css-loader": "*",
"webpack": "^4.1.0"
"webpack": "^4.1.0 || ^5.0.0"
},
"dependencies": {
"@vue/component-compiler-utils": "^2.4.0",
Expand Down