-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
68 lines (64 loc) · 1.98 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
64
65
66
67
68
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir);
}
function addStyleResource(rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/assets/style/global.styl'),
],
});
}
module.exports = {
devServer: {
disableHostCheck: true,
proxy: {
'/api': {
target: 'http://127.0.0.1:5010/',
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
},
},
},
chainWebpack: (config) => {
config.resolve.alias
.set('@/views', resolve('src/views'))
.set('@/assets', resolve('src/assets'))
.set('@/components', resolve('src/components'))
.set('@/utils', resolve('src/utils'));
const types = ['vue-modules', 'vue', 'normal-modules', 'normal'];
types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type)));
},
pages: {
popup: {
entry: 'src/popup.ts',
// 模板来源
template: 'public/popup.html',
// 在 dist/popup.html 的输出
filename: 'popup.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: '书签',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'popup'],
},
background: {
entry: 'src/background.ts',
// 模板来源
template: 'public/background.html',
// 在 dist/background.html 的输出
filename: 'background.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: '书签',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'background'],
},
},
};