import merge from 'webpack-merge' ; import { getCommonConfig } from './webpack.common' ; import OptimizeCSSAssetsPlugin from 'optimize-css-assets-webpack-plugin' ; import TerserJSPlugin from 'terser-webpack-plugin' ; import MiniCssExtractPlugin from 'mini-css-extract-plugin' ; import webpack from 'webpack' ; const prodConfig = { mode : 'production' , optimization : { minimizer : [ new TerserJSPlugin ( { } ) , new OptimizeCSSAssetsPlugin ( { } ) ] , } , module : { rules : [ { test : /\.css$/ , exclude : /node_modules/ , use : [ { loader : MiniCssExtractPlugin . loader , } , 'css-loader' , ] , } , ] , } , plugins : [ new MiniCssExtractPlugin ( { filename : '[name].css' , chunkFilename : '[id].css' , ignoreOrder : false , } ) , ] , } ; export default merge ( getCommonConfig ( ) , prodConfig ) ;