Commit 0b006a37 authored by Evan You's avatar Evan You

fix: ensure plugin error is emitted only once

parent b1023cd7
...@@ -12,14 +12,17 @@ const genCustomBlocksCode = require('./codegen/customBlocks') ...@@ -12,14 +12,17 @@ const genCustomBlocksCode = require('./codegen/customBlocks')
const componentNormalizerPath = require.resolve('./runtime/componentNormalizer') const componentNormalizerPath = require.resolve('./runtime/componentNormalizer')
const { NS } = require('./plugin') const { NS } = require('./plugin')
let errorEmitted = false
module.exports = function (source) { module.exports = function (source) {
const loaderContext = this const loaderContext = this
if (!loaderContext['thread-loader'] && !loaderContext[NS]) { if (!errorEmitted && !loaderContext['thread-loader'] && !loaderContext[NS]) {
loaderContext.emitError(new Error( loaderContext.emitError(new Error(
`vue-loader was used without the corresponding plugin. ` + `vue-loader was used without the corresponding plugin. ` +
`Make sure to include VueLoaderPlugin in your webpack config.` `Make sure to include VueLoaderPlugin in your webpack config.`
)) ))
errorEmitted = true
} }
const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r) const stringifyRequest = r => loaderUtils.stringifyRequest(loaderContext, r)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment