-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
63 lines (61 loc) · 1.91 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 webpack = require('webpack');
const path = require('path');
const proxy = {
'/eperusteet-amosaa-service': {
target: `http://localhost:${process.env.AMOSAA_SERVICE_PORT || 8082}`,
secure: false,
onProxyReq: function(proxyReq, req, res) {
proxyReq.setHeader('Caller-Id', '1.2.246.562.10.00000000001.eperusteet');
},
},
'/eperusteet-service': {
target: `http://localhost:${process.env.EPERUSTEET_SERVICE_PORT || 8080}`,
secure: false,
onProxyReq: function(proxyReq, req, res) {
proxyReq.setHeader('Caller-Id', '1.2.246.562.10.00000000001.eperusteet');
},
},
};
module.exports = {
lintOnSave: false,
publicPath: process.env.NODE_ENV === 'production' ? '/eperusteet-amosaa-service/ui' : '/',
configureWebpack: {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@shared': path.resolve(__dirname, 'eperusteet-frontend-utils/vue/src'),
'@assets': path.resolve(__dirname, 'eperusteet-frontend-utils/vue/public'),
'@public': path.resolve(__dirname, 'public'),
},
},
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/,
}),
],
},
chainWebpack: config => {
// enabloidaan sourcemap ja nimetään "oikeat" vuen scirpti-tiedostot uudelleen, jotta löytyy selaimen devtoolsissa helpommin
// esim. RouteRoot.vue?bf9d -> RouteRoot.vue?script
if (process.env.USE_SOURCEMAP) {
config.devtool('source-map');
config.output.devtoolModuleFilenameTemplate(info => {
if (info.resourcePath.endsWith('.vue')) {
if (info.query.startsWith('?vue&type=script') && !info.allLoaders.includes('babel')) {
return `src://${info.resourcePath}?script`;
}
}
});
}
},
devServer: {
overlay: {
warnings: false,
errors: true,
},
clientLogLevel: 'none',
port: 9002,
proxy,
},
};