报错问题:
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)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。