-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.chrome.config.js
47 lines (45 loc) · 1.62 KB
/
webpack.chrome.config.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
const path = require('path')
const ZipWebpackPlugin = require('zip-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const webpackMerge = require('webpack-merge')
const commonConfig = require('./webpack.common.config')
const Package = require('./package.json')
module.exports = webpackMerge.merge(commonConfig, {
output: {
filename: '[name].bundle.js',
path: path.join(__dirname, 'build', 'chrome')
},
plugins: [
new CopyWebpackPlugin({
patterns: [{
context: 'app/',
from: '_locales',
to: path.join(__dirname, 'build', 'chrome', '_locales')
}, {
context: 'app/',
from: 'images',
to: path.join(__dirname, 'build', 'chrome', 'images')
}, {
context: 'app/',
from: 'manifest_chrome.json',
to: path.join(__dirname, 'build', 'chrome', 'manifest.json')
}]
}),
new ZipWebpackPlugin({
path: path.join(__dirname, 'dist', 'chrome'),
filename: Package.name,
exclude: [/\.map$/],
// OPTIONAL: see https://github.com/thejoshwolfe/yazl#addfilerealpath-metadatapath-options
fileOptions: {
mtime: new Date(),
mode: 0o100664,
compress: true,
forceZip64Format: false,
},
// OPTIONAL: see https://github.com/thejoshwolfe/yazl#endoptions-finalsizecallback
zipOptions: {
forceZip64Format: false,
},
})
]
})