const?path?=?require('path')
const??{?VueLoaderPlugin?}??=?require('vue-loader')
const?HTMLPlugin?=?require('html-webpack-plugin')
const?webpack?=?require('webpack')
const?isDev?=?process.env.NODE_ENV?===?'development'
const?config?=?{
????target:?'web',
????entry:?path.join(__dirname,?'src/index.js'),
????output:?{
????????filename:?'bundle.js',
????????path:?path.join(__dirname,?'dist')
????},
????module:{
????????rules:?[
????????????{
??????????????test:?/\.vue$/,
??????????????use:?[
??????????????????{loader:?'vue-loader'}
??????????????]
????????????},
????????]
????},
????plugins:?[
????????new?VueLoaderPlugin(),
????????new?webpack.DefinePlugin({
????????????'process.env':?{
????????????????NODE_ENV:?isDev???'"development"'?:?'"production"'
????????????}
????????}),
????????new?HTMLPlugin()
????]
}
if(isDev){
??config.devServer?=?{
??????port:?8000,
??????host:?'0.0.0.0',
??????overlay:?{
??????????errors:?true
??????},
??????open:?true
??}
}
module.export?=?config
2018-06-20
2018-05-26
方法一: 把vue-loader版本替換為14
方法二: 根據(jù)vue-loader官方提供的15版本的聲明方法,定義plugin。
2018-05-25
把vue-loader的版本替換成^14.2.0試一下