-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path_vue.config.js
More file actions
109 lines (105 loc) · 3.39 KB
/
_vue.config.js
File metadata and controls
109 lines (105 loc) · 3.39 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
const { gitDescribeSync } = require('git-describe');
const path = require('path');
const http = require('http');
const packagejson = require('./package.json');
const SentryPlugin = require('@sentry/webpack-plugin');
const keepAliveAgent = new http.Agent({ keepAlive: true });
process.env.VITE_APP_GIT_HASH = gitDescribeSync().hash;
process.env.VITE_APP_VERSION = packagejson.version;
function chainWebpack(config) {
config.output.strictModuleExceptionHandling(true);
config.resolve.symlinks(false);
config.resolve.alias.set('dive-common', path.resolve(__dirname, 'dive-common'));
config.resolve.alias.set('vue-media-annotator', path.resolve(__dirname, 'src'));
config.resolve.alias.set('platform', path.resolve(__dirname, 'platform'));
config.externals({
/**
* Specify vtkjs as external dependency on global context to
* prevent it from being included in bundle (2MB savings)
*/
'vtk.js': 'vtkjs',
});
if (process.env.SENTRY_AUTH_TOKEN) {
config
.plugin('SentryPlugin')
.use(SentryPlugin, [{
authToken: process.env.SENTRY_AUTH_TOKEN,
include: './dist',
org: 'kitware-data',
project: 'viame-web-client',
release: process.env.VITE_APP_GIT_HASH
}]);
}
config.module
.rule('babel')
.test(/\.js$/)
.exclude.add(/node_modules/)
.end()
.use('babel-loader')
.loader('babel-loader')
.options({
presets: ['@babel/preset-env']
});
}
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8010',
secure: false,
ws: true,
agent: keepAliveAgent,
},
},
},
productionSourceMap: true,
publicPath: process.env.VITE_APP_STATIC_PATH,
chainWebpack,
pluginOptions: {
electronBuilder: {
mainProcessFile: 'platform/desktop/background.ts',
// https://github.com/nklayman/vue-cli-plugin-electron-builder/pull/1088
rendererProcessFile: 'platform/desktop/main.ts',
// https://www.electron.build/configuration/configuration
builderOptions: {
appId: 'com.kitware.viame',
productName: 'DIVE-Desktop',
copyright: 'Copyright © 2022 Kitware, Inc.',
directories: {
buildResources: 'platform/desktop/buildResources',
},
extraFiles: [
{
from: 'node_modules/ffmpeg-ffprobe-static',
to: 'resources/ffmpeg-ffprobe-static',
filter: ['ff*'],
},
],
// extraMetadata will be merged with package.json in args to electron-builder
extraMetadata: {
// https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/188
// https://github.com/electron-userland/electron-builder/issues/2592
main: 'background.js',
name: 'DIVE-Desktop'
},
linux: {
target: ['AppImage', 'tar.gz'],
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'DIVE-Desktop-${version}.${ext}',
},
win: {
target: ['portable', 'zip'],
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'DIVE-Desktop-${version}.${ext}',
},
},
chainWebpackMainProcess: chainWebpack,
/**
* Node Integration is needed for this app,
* so we will have to be careful with RCE
* and issues with running unsafe scripts
*/
nodeIntegration: true,
},
},
};