美文网首页
webpack.config.js简单模板

webpack.config.js简单模板

作者: 尤樊容 | 来源:发表于2018-05-11 11:32 被阅读25次

/**

  • Created by Administrator on 2018/3/23.
    */
    const path = require('path');
    const HtmlWebpackPlugin = require('html-webpack-plugin');
    const CleanWebpackPlugin = require('clean-webpack-plugin');

module.exports = {
mode: 'development',
//entry: './src/index.js',
entry: {
app: './src/index.js',
print: './src/print.js'
},
output: {
//filename: 'bundle.js',
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
devtool: 'inline-source-map',
devServer:{
contentBase: './dist'
},
plugins:[
new CleanWebpackPlugin(['dist']),//每次清空/dist文件
new HtmlWebpackPlugin({//从新生成html
title: 'Output Management'
})
]
};

相关文章

网友评论

      本文标题:webpack.config.js简单模板

      本文链接:https://www.haomeiwen.com/subject/hqhfdftx.html