Skip to content
Merged
Changes from all commits
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
12 changes: 7 additions & 5 deletions src/pluginWebpack5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ class VueLoaderPlugin implements Plugin {
static NS = NS

apply(compiler: Compiler) {
// @ts-ignore
const normalModule = compiler.webpack.NormalModule || NormalModule

// add NS marker so that the loader can detect and report missing plugin
compiler.hooks.compilation.tap(id, (compilation) => {
NormalModule.getCompilationHooks(compilation).loader.tap(
id,
(loaderContext: any) => {
normalModule
.getCompilationHooks(compilation)
.loader.tap(id, (loaderContext: any) => {
loaderContext[NS] = true
}
)
})
})

const rules = compiler.options.module!.rules
Expand Down