webpack.config.babel.js
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import webpack, {DefinePlugin} from 'webpack';
import merge from 'webpack-merge';
import baseConfig from '../../webpack.public.config';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import config from './src/config';
export default merge(baseConfig, {
//项目入口js文件
entry: ['./app/guoChao/src/index.js'],
devServer:{
publicPath: config.routerPath
},
plugins: [
// new HtmlWebpackPlugin({
// filename: 'index.html',
// template: './app/guoChao/index.html',
// }),
new HtmlWebpackPlugin({
filename: 'top40.html',
template: './app/guoChao/index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
}
}),
new HtmlWebpackPlugin({
filename: 'guochao.html',
template: './app/guoChao/index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
}
}),
]
});