-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
62 lines (59 loc) · 1.45 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
const path = require('path');
const src = path.resolve(__dirname, 'ui', 'src');
const dist = path.resolve(__dirname, 'ui', 'dist');
const inject = false;
const minify = false;
const template = path.resolve(src, '_common', 'index.html');
const pages = {
home: {
entry: path.resolve(src, 'home', 'main.js'),
filename: path.join('templates', 'ui', 'home.html'),
title: 'Home',
template,
inject,
minify,
},
about: {
entry: path.resolve(src, 'about', 'main.js'),
filename: path.join('templates', 'ui', 'about.html'),
title: 'About',
template,
inject,
minify,
},
list: {
entry: path.resolve(src, 'list', 'main.js'),
filename: path.join('templates', 'ui', 'list.html'),
title: 'List',
template,
inject,
minify,
},
detail: {
entry: path.resolve(src, 'detail', 'main.js'),
filename: path.join('templates', 'ui', 'detail.html'),
title: 'Detail',
template,
inject,
minify,
},
};
module.exports = {
pages,
outputDir: path.resolve(dist, 'ui'),
publicPath: '/static/ui/',
chainWebpack: config => {
config.resolve.alias.set('@', src);
Object.keys(pages).forEach(page => {
config.plugins.delete(`preload-${page}`);
config.plugins.delete(`prefetch-${page}`);
});
},
css: { sourceMap: true },
devServer: {
writeToDisk: filePath => {
return /\.html$/.test(filePath);
},
proxy: { '/': { target: 'http://localhost:8000' } },
},
};