1 | exports.name = 'builtin:config-electron'
|
2 |
|
3 | exports.apply = api => {
|
4 | api.hook('createWebpackChain', config => {
|
5 | if (api.config.target !== 'electron') return
|
6 |
|
7 | // Force public URL
|
8 | config.output.publicPath('./')
|
9 | config.plugin('envs').tap(([options]) => [
|
10 | Object.assign(options, {
|
11 | PUBLIC_URL: JSON.stringify('./')
|
12 | })
|
13 | ])
|
14 |
|
15 | config.target('electron-renderer')
|
16 | })
|
17 | }
|