-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
92 lines (88 loc) · 2.54 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
require("ts-node").register();
const
{ buildService } = require("./tools/build.service"),
configureWebpack = require("./tools/webpack.config"),
overlayConfig = buildService.selectedOverlayConfig;
const
listen = process.env.LISTEN || "localhost:8888",
parts = listen.split(":"),
host = parts[0],
portString = parts[1] || "8888",
parsed = parseInt(portString),
port = isNaN(parsed) || parsed < 80
? 8888
: parsed;
function generateExclusionsForOtherOverlays(
thisOverlay,
allOverlays) {
const toExclude = new Set(allOverlays);
toExclude.delete(thisOverlay);
return Array.from(toExclude).map(overlayName => {
const re = `overlays[/|\\\\]${overlayName}[/|\\\\]`;
return new RegExp(re);
});
}
module.exports = {
outputDir: overlayConfig.distributionDirectory,
pages: {
app: {
entry: "src/main.ts",
template: "static/index.html",
filename: "index.html",
title: overlayConfig.title,
metaDescription: overlayConfig.metaDescription,
},
},
css: {
loaderOptions: {
sass: {
data: `@import "@/scss/config.scss";`,
}
},
},
devServer: {
disableHostCheck: true,
host,
compress: true,
https: true,
port,
proxy: {
"/rtapi": {
target: "https://api.le_default.com",
ws: true,
changeOrigin: true,
},
},
},
productionSourceMap: false,
configureWebpack,
chainWebpack: config => {
debugger;
config.module
.rule("images")
.use("url-loader")
.loader("url-loader")
.tap(options => Object.assign({}, options, { limit: 512 }));
config.module
.rule("ts")
.use("ts-loader")
.loader("ts-loader")
.tap(options => {
return Object.assign(
{},
options,
{
appendTsSuffixTo: [],
experimentalWatchApi: true,
experimentalFileCaching: true
});
});
const exclude = config.module.rule("vue").exclude;
const regexes = generateExclusionsForOtherOverlays(
overlayConfig.name,
buildService.listAllOverlays()
)
regexes.forEach(re => exclude.add(re));
},
pwa: overlayConfig.pwaConfig
};