vue与webpack
npm install vue@next
npm install vue-loader@next -D
npm install @vue/compiler-sfc -D
在webpack.config.js中,
const {VueLoaderPlugin} = require(‘vue-loader/dist/index’);
在module.exports中module的rules中:
module:{
rules:[{
test:/.vue$/,
loader:“vue-loader”
} ]
}
在module.exports中plugins中:
plugins:[
new VueLoaderPlugin(),
],