-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvue.config.js
More file actions
127 lines (116 loc) · 3.15 KB
/
vue.config.js
File metadata and controls
127 lines (116 loc) · 3.15 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const IS_DEV = process.env.NODE_ENV === 'development';
const path = require('path');
const HawkWebpackPlugin = require('@hawk.so/webpack-plugin');
const buildRevision = Date.now();
const webpackPlugins = [];
/**
* Add the Hawk plugin for sending source maps
*/
if (process.env.VUE_APP_HAWK_TOKEN) {
webpackPlugins.push(
new HawkWebpackPlugin({
integrationToken: process.env.VUE_APP_HAWK_TOKEN,
release: buildRevision,
})
);
}
module.exports = {
pages: {
index: {
entry: './src/renderer/main.js',
template: './public/index.html',
},
},
configureWebpack: {
target: 'web',
resolve: {
alias: {
'@static': path.resolve(__dirname, 'public'),
'@': path.resolve(__dirname, 'src/renderer'),
'@sdk': path.resolve(__dirname, 'src/sdk'),
'@assets': path.resolve(__dirname, 'src/sdk/assets'),
'@styles': path.resolve(__dirname, 'src/renderer/styles'),
'@views': path.resolve(__dirname, 'src/renderer/views'),
'@components': path.resolve(__dirname, 'src/sdk/components'),
'@libs': path.resolve(__dirname, 'src/sdk/libs'),
'@classes': path.resolve(__dirname, 'src/renderer/classes'),
'@shared': path.resolve(__dirname, 'src/shared'),
'@api': path.resolve(__dirname, 'src/sdk/api'),
'@contextMenus': path.resolve(__dirname, 'src/renderer/views/ContextMenus'),
},
},
plugins: webpackPlugins,
devtool: IS_DEV ? 'source-map' : 'hidden-source-map',
},
pluginOptions: {
electronBuilder: {
customFileProtocol: 'heyka://./',
mainProcessFile: 'src/main/index.js',
builderOptions: {
protocols: {
name: 'Heyka',
schemes: [
'heyka',
],
},
},
preload: 'public/preload.js',
},
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'translations',
enableInSFC: true,
},
svgSprite: {
dir: 'src/sdk/assets/icons',
test: /\.svg$/,
loaderOptions: {
extract: true,
spriteFilename: 'img/icons.svg',
},
},
},
chainWebpack: config => {
const mediaRule = config.module.rule('media');
mediaRule.uses.clear();
mediaRule
.test(/\.(ogg|mp3|wav|flac|aac)(\?.*)?$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
return {
limit: 4096,
fallback: {
loader: 'file-loader',
options: {
name: 'media/[name].[hash:8].[ext]',
},
},
};
});
config.module
.rule('video')
.test(/\.(mp4|webp)?$/)
.use('url-loader')
.loader('url-loader');
config.module
.rule('svg-sprite')
.use('svgo-loader')
.loader('svgo-loader');
/**
* Use DefinePlugin to pass some variables to the sources
*/
config.plugin('define').tap((definitions) => {
definitions[0] = {
...definitions[0],
/**
* Current bundle version will be passed to the Hawk Catcher
*/
buildRevision,
};
return definitions;
});
config.optimization.minimize(false);
},
};