Skip to content

Commit 2472b2f

Browse files
committed
fix: check for compiler.webpack existence
It's only available since webpack 5.1
1 parent f7ee30b commit 2472b2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/plugin-webpack5.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const ruleSetCompiler = new RuleSetCompiler([
3131

3232
class VueLoaderPlugin {
3333
apply (compiler) {
34-
const normalModule = compiler.webpack.NormalModule || require("webpack/lib/NormalModule")
34+
const normalModule = compiler.webpack
35+
? compiler.webpack.NormalModule
36+
: require('webpack/lib/NormalModule')
3537
// add NS marker so that the loader can detect and report missing plugin
3638
compiler.hooks.compilation.tap(id, compilation => {
3739
const normalModuleLoader = normalModule.getCompilationHooks(compilation).loader

0 commit comments

Comments
 (0)