| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const merge = require('webpack-merge');
- const common = require('./webpack.common.config.js');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
- module.exports = merge(common, {
- optimization: {
- splitChunks: {
- chunks: 'all',
- minSize: 30000,
- maxSize: 0,
- minChunks: 1,
- cacheGroups: {
- framework: {
- test: "framework",
- name: "framework",
- enforce: true
- },
- vendors: {
- priority: -10,
- test: /node_modules/,
- name: "vendor",
- enforce: true,
- },
- }
- }
- },
- mode: 'production',
- output: {
- filename: 'nodejs/[name].[chunkhash:8].bundle.js',
- },
- plugins: [
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'public/index.html',
- chunks:['workbench','framework'],
- // inject: 'body',
- // minify: {
- // removeComments: true,
- // collapseWhitespace: true,
- // },
- })
- //,new CleanWebpackPlugin()
- ]
- });
|