解决使用vue-loader15.xx时,已经添加了VueLoaderPlugin,还是报错问题
文章目录
报错问题:
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.vue-loader15.x以上,都是需要VueLoaderPlugin插件才能正常解析,但添加了还是提示报错。
// webpack.common.js
//在vue-loader中拿到VueLoaderPlugin函数
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
...
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
}
]
},
plugins: [
...
// make sure to include the plugin for the magic
new VueLoaderPlugin(),
]
...
}上面使用不会有问题,但如果使用了speed-measure-webpack-plugin插件,那就会报错
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const smp = new SpeedMeasurePlugin()
const devModule = {...}
module.exports = smp.wrap(devModule)
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论