-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.firefox.js
More file actions
46 lines (44 loc) · 1.22 KB
/
webpack.firefox.js
File metadata and controls
46 lines (44 loc) · 1.22 KB
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
const merge = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const Dotenv = require('dotenv-webpack');
const common = require('./webpack.common.js');
module.exports = (env) => {
const commonConfig = common(env);
return merge(commonConfig, {
mode: 'production',
optimization: {
...commonConfig.optimization,
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
},
styles: {
name: 'styles',
test: /\.scss$/,
chunks: 'all',
enforce: true,
},
},
},
},
plugins: [
...commonConfig.plugins,
new CopyWebpackPlugin([
{ from: 'icon16.png', to: 'icon16.png' },
{ from: 'icon48.png', to: 'icon48.png' },
{ from: 'icon128.png', to: 'icon128.png' },
{ from: 'favicon.ico', to: 'favicon.ico' },
{ from: 'content.js', to: 'content.js' },
{ from: 'firefox.manifest.json', to: 'manifest.json' },
]),
new Dotenv({
path: './.env.firefox',
}),
],
});
};