-
-
Notifications
You must be signed in to change notification settings - Fork 841
Expand file tree
/
Copy pathwebpack.config.js
More file actions
28 lines (24 loc) 路 813 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
28 lines (24 loc) 路 813 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
const neutrino = require('neutrino')
const argv = require('yargs-parser')(process.argv.slice(2))
const createNeutrinoConfig = require('./scripts/create-neutrino-config')
const { getBrowsersByManifestVersion } = require('./scripts/webext-targets')
if (argv.mode !== 'production') {
module.exports = neutrino(createNeutrinoConfig()).webpack()
} else {
const configs = [2, 3]
.map(manifestVersion => {
const browsers = getBrowsersByManifestVersion(manifestVersion)
if (!browsers.length) {
return null
}
return neutrino(
createNeutrinoConfig({
manifestVersion,
browsers,
output: `build/.tmp-mv${manifestVersion}`
})
).webpack()
})
.filter(Boolean)
module.exports = configs.length === 1 ? configs[0] : configs
}