-
Notifications
You must be signed in to change notification settings - Fork 5
/
vue.config.js
63 lines (58 loc) · 1.59 KB
/
vue.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const chainWebpack = require('./chainWebpack.config.js');
const backgroundMode = process.env.BACKGROUND_MODE;
const devtoolMode = process.env.DEVTOOL_MODE;
const newtabMode = process.env.NEWTAB_MODE;
const config = {
devServer: {
writeToDisk: true,
hot: false,
disableHostCheck: true,
},
filenameHashing: false,
pages: {
options: {
entry: 'src/options/index.js',
template: 'public/index.html',
filename: 'options.html',
title: 'Options',
chunks: ['chunk-vendors', 'chunk-common', 'options'],
},
popup: {
entry: 'src/popup/index.js',
template: 'public/index.html',
filename: 'popup.html',
title: 'Popup',
chunks: ['chunk-vendors', 'chunk-common', 'popup'],
},
},
css: {
extract: true,
},
chainWebpack,
}
if (backgroundMode === 'html') {
config.pages['background'] = {
entry: 'src/background/index.js',
template: 'public/index.html',
filename: 'background.html',
title: 'Background',
chunks: ['chunk-vendors', 'chunk-common', 'background'],
}
}
if (devtoolMode) {
config.pages['devtool'] = {
entry: 'src/devtool/index.js',
template: 'public/index.html',
filename: 'devtool.html',
title: 'Devtool',
}
}
if (newtabMode) {
config.pages['newtab'] = {
entry: 'src/newtab/index.js',
template: 'public/index.html',
filename: 'newtab.html',
title: 'NewTab',
}
}
module.exports = config;