2021-07-28 22:15:52 +09:00
|
|
|
const path = require('path');
|
|
|
|
const common = require('./webpack.common');
|
|
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
2021-08-03 12:12:12 +09:00
|
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
2021-07-28 22:15:52 +09:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: 'production',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: '[name].[contenthash].bundle.js',
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
minimizer: [
|
|
|
|
'...',
|
|
|
|
new CssMinimizerPlugin(),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.s?css$/,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin(),
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: '[name].[contenthash].bundle.css',
|
|
|
|
}),
|
2021-08-03 12:12:12 +09:00
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: 'olm.wasm' },
|
|
|
|
{ from: '_redirects' },
|
|
|
|
],
|
|
|
|
}),
|
2021-07-28 22:15:52 +09:00
|
|
|
],
|
|
|
|
});
|