-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
60 lines (56 loc) · 1.8 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
const CopyPlugin = require('copy-webpack-plugin');
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
const SentryCliPlugin = require('@sentry/webpack-plugin');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require('fs');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
const plugins = [];
if (process.env.NODE_ENV === 'production') {
const sentryAuthToken = fs.readFileSync('/run/secrets/SENTRY_AUTH_TOKEN', 'utf8');
plugins.push(
new SentryCliPlugin({
// webpack specific configuration
authToken: sentryAuthToken,
include: '.',
ignore: ['node_modules', 'babel.config.js', 'apollo.config.js', '.eslintrc.js'],
release: `unikube-frontend@${process.env.VUE_APP_VERSION}`,
}),
);
}
plugins.push(new MonacoWebpackPlugin({
customLanguages: [{
label: 'yaml',
entry: undefined,
worker: {
id: 'yaml-worker',
entry: path.resolve(__dirname, 'node_modules/monaco-yaml/lib/esm/yaml.worker'),
},
}],
}));
module.exports = {
transpileDependencies: [
'vuetify',
],
configureWebpack: {
plugins,
},
chainWebpack: (config) => {
config
.externals(process.env.NODE_ENV === 'production' ? {
'keycloak-js': 'Keycloak',
'keycloak-js/dist/keycloak-authz': 'KeycloakAuthorization',
} : {});
config
.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@intlify/vue-i18n-loader')
.end();
},
};