/**
- 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'
})
]
};