const webpack = require("webpack"); const common = require("./webpack.common"); const merge = require("webpack-merge"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = merge(common, { mode: "production", devtool: "none", output: { filename: "[name].[contenthash].min.js", chunkFilename: "[id].[name].[contenthash].min.js", publicPath: "dist/", }, module: { rules: [ { test: /\.(sa|sc|c)ss$/, use: [ "style-loader", MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader", ], }, ], }, plugins: [ new MiniCssExtractPlugin({ filename: "[name].[contenthash].min.css", chunkFilename: "[name].[contenthash].min.css", sourceMap: true, }), new webpack.HashedModuleIdsPlugin(), ], });