forked from EDCD/coriolis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
52 lines (48 loc) · 1.44 KB
/
webpack.config.prod.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { InjectManifest } = require('workbox-webpack-plugin');
module.exports = merge(common, {
// devtool: 'source-map',
mode: 'production',
optimization: {
minimize: true,
},
output: {
globalObject: 'this'
},
plugins: [
new CopyWebpackPlugin({
patterns: [
'src/.htaccess',
'src/iframe.html',
'src/xdLocalStoragePostMessageApi.min.js',
{ from: 'src/schemas', to: 'schemas' },
{
from: 'src/images/logo/*',
to: '[name][ext]'
}
]}),
/* new HtmlWebpackPlugin({
// uaTracking: process.env.CORIOLIS_UA_TRACKING || '',
}), */
new MiniCssExtractPlugin({
filename: '[contenthash:6].css',
}),
// new BugsnagBuildReporterPlugin({
// apiKey: 'ba9fae819372850fb660755341fa6ef5',
// appVersion: `${pkgJson.version}-${buildDate.toISOString()}`
// }, { /* opts */ }),
// new BugsnagSourceMapUploaderPlugin({
// apiKey: 'ba9fae819372850fb660755341fa6ef5',
// overwrite: true,
// appVersion: `${pkgJson.version}-${buildDate.toISOString()}`
// }),
new InjectManifest({
swSrc: './src/sw.js',
swDest: 'service-worker.js'
}),
]
});