-
Notifications
You must be signed in to change notification settings - Fork 34
/
vue.config.js
95 lines (93 loc) · 3.05 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
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
const path = require('path')
const webpack = require('webpack')
const { notarize } = require('electron-notarize')
require('dotenv').config()
module.exports = {
pluginOptions: {
// Automatically import base styles into every Vue component <style>
'style-resources-loader': {
patterns: [path.resolve(__dirname, 'src/styles/*.scss')],
preProcessor: 'scss'
},
electronBuilder: {
builderOptions: {
appId: 'io.kava.switch',
productName: 'Switch',
win: {
target: 'nsis'
},
linux: {
category: 'Finance',
packageCategory: 'wallet',
target: 'AppImage'
},
mac: {
category: 'public.app-category.finance',
/**
* To enable notarizing the app, followed the configuration outlined by this tutorial:
* https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/
*/
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: 'public/entitlements.mac.plist',
entitlementsInherit: 'public/entitlements.mac.plist'
},
afterSign: async context => {
const { electronPlatformName, appOutDir } = context
const appName = context.packager.appInfo.productFilename
if (electronPlatformName === 'darwin') {
return notarize({
appBundleId: 'io.kava.switch',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD
})
}
},
// Include ths OS so it's clearer which to download from the filename
artifactName: '${productName}-${os}-v${version}.${ext}'
},
chainWebpackRendererProcess: config => {
/**
* When Webpack builds for the "electron-renderer" target, it prioritizes
* the entry for the package.json `browser` field above `main`
*
* - Some modules, such as ws and ripple-lib, have different behavior in the browser,
* so don't resolve the browser field
* - Only apply this for Electron builds, and not browser builds
*/
config.resolve.mainFields
.clear()
.add('main')
.add('module')
}
}
},
chainWebpack: config => {
/** For development, show debug logs */
if (process.env.NODE_ENV !== 'production') {
config
.plugin('environment')
.after('define')
.use(webpack.EnvironmentPlugin, [
{
/** Do NOT add quotes. '"ilp*"' doesn't work! */
DEBUG: 'ilp*,switch*'
}
])
}
},
/*
* Importing MDC component styles causes issues with our Webpack config, which this fixes:
* https://github.com/material-components/material-components-web/issues/351#issuecomment-318981488
*/
css: {
loaderOptions: {
sass: {
includePaths: ['node_modules', 'node_modules/@material/*'].map(d =>
path.join(__dirname, d)
)
}
}
}
}