This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
61 lines (56 loc) · 1.5 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
const { defineConfig } = require('@vue/cli-service');
// BGN git revision
const webpack = require('webpack');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin({ branch: true });
// END git revision
module.exports = defineConfig({
productionSourceMap: false,
// https://webpack.js.org/configuration/dev-server/
devServer: {
allowedHosts: 'all',
host: 'localhost',
//port: 8080,
headers: { 'Access-Control-Allow-Origin': '*' },
client: {
logging: 'info',
},
proxy: {
'/': {
target: process.env.VUE_APP_API_URL,
secure: false,
changeOrigin: true,
preserveHeaderKeyCase: true,
ws: false,
},
},
},
configureWebpack: {
plugins: [
gitRevisionPlugin,
new webpack.DefinePlugin({
VUE_APP_BUILD_HASH: JSON.stringify(gitRevisionPlugin.commithash()),
VUE_APP_BUILD_BRANCH: JSON.stringify(gitRevisionPlugin.branch()),
VUE_APP_BUILD_TIME: JSON.stringify(new Date().toISOString()),
}),
],
},
chainWebpack: config => {
config.module.rule('images').set('parser', {
dataUrlCondition: {
maxSize: 0,
},
});
},
pluginOptions: {
i18n: {
locale: process.env.VUE_APP_I18N_LOCALE,
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE,
localeDir: 'locale',
enableLegacy: false,
runtimeOnly: false,
compositionOnly: false,
fullInstall: true,
},
},
});