const { merge } = require('webpack-merge'); const common = require('./webpack.common.js'); const path = require('path'); module.exports = merge(common, { mode: 'production', devtool: 'source-map', output: { filename: '[name].bundle.js', path: path.resolve(__dirname, 'dist') }, optimization: { minimize: true, usedExports: true, splitChunks: { cacheGroups: { vendors: { test: /node_modules\/(?!antd\/).*/, name: "vendors", chunks: "all", }, // This can be your own design library. antd: { test: /node_modules\/(antd\/).*/, name: "antd", chunks: "all", }, }, } } });