forked from MoeFE/GoogleTranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
49 lines (45 loc) · 1.38 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
/* eslint-disable global-require */
const path = require('path');
module.exports = {
pluginOptions: {
electronBuilder: {
outputDir: 'build',
mainProcessFile: 'src/main/index.js',
disableMainProcessTypescript: true,
builderOptions: {
productName: 'Google 翻译',
appId: 'org.moefe.googletranslate',
mac: {
icon: 'build/bundled/icon.icns',
},
},
},
},
chainWebpack: (config) => {
if (process.env.NODE_ENV !== 'production') {
config.module
.rule('tsx')
.test(/\.tsx$/)
.use('vue-jsx-hot-loader')
.before('babel-loader')
.loader('vue-jsx-hot-loader');
}
config
.entry('app')
.clear()
.add('./src/renderer/main.ts');
config.plugin('define').tap((args) => {
Object.assign(args[0], {
VERSION: JSON.stringify(require('./package.json').version),
});
return args;
});
config.resolve.alias
.set('@', path.resolve(__dirname, 'src/renderer'))
.set('emotion', path.resolve(__dirname, 'src/renderer/lib/emotion.js'))
.set('assets', path.resolve(__dirname, 'src/renderer/assets'))
.set('components', path.resolve(__dirname, 'src/renderer/components'))
.set('utils', path.resolve(__dirname, 'src/renderer/utils'))
.set('views', path.resolve(__dirname, 'src/renderer/views'));
},
};