forked from SFDO-Tooling/MetaCI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
35 lines (29 loc) · 954 Bytes
/
webpack.prod.js
File metadata and controls
35 lines (29 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* eslint-disable no-process-env */
'use strict';
process.env.NODE_ENV = 'production';
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const merge = require('webpack-merge');
const webpack = require('webpack');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
output: {
filename: '[name].[chunkhash].min.js',
path: path.join(__dirname, 'dist', 'prod'),
},
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(),
new OptimizeCSSAssetsPlugin(),
new MiniCssExtractPlugin({
filename: '[name].[chunkhash].min.css',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.HashedModuleIdsPlugin(),
],
});