webpack.config.babel.js 1.16 KB
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
            }
        }),
    ]
});