Skip to content

Commit 0b006a3

Browse files
committed
fix: ensure plugin error is emitted only once
1 parent b1023cd commit 0b006a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ const genCustomBlocksCode = require('./codegen/customBlocks')
1212
const componentNormalizerPath = require.resolve('./runtime/componentNormalizer')
1313
const { NS } = require('./plugin')
1414

15+
let errorEmitted = false
16+
1517
module.exports = function (source) {
1618
const loaderContext = this
1719

18-
if (!loaderContext['thread-loader'] && !loaderContext[NS]) {
20+
if (!errorEmitted && !loaderContext['thread-loader'] && !loaderContext[NS]) {
1921
loaderContext.emitError(new Error(
2022
`vue-loader was used without the corresponding plugin. ` +
2123
`Make sure to include VueLoaderPlugin in your webpack config.`
2224
))
25+
errorEmitted = true
2326
}
2427

2528
const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)

0 commit comments

Comments
 (0)