PicList/vue.config.js

136 lines
3.4 KiB
JavaScript
Raw Normal View History

2019-12-19 06:17:21 -05:00
const path = require('path')
function resolve (dir) {
return path.join(__dirname, dir)
}
const config = {
configureWebpack: {
devtool: 'nosources-source-map'
},
2019-12-19 06:17:21 -05:00
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src/renderer'))
.set('~', resolve('src'))
.set('root', resolve('./'))
.set('#', resolve('src/universal'))
2021-04-10 09:01:55 -04:00
// define
// config.plugin('define')
// .tap(args => {
// return args
// })
2019-12-19 06:17:21 -05:00
},
pluginOptions: {
electronBuilder: {
nodeIntegration: true, // will remove in the future
customFileProtocol: 'picgo://./',
externals: ['piclist'],
2019-12-19 06:17:21 -05:00
chainWebpackMainProcess: config => {
config.resolve.alias
.set('@', resolve('src/renderer'))
.set('~', resolve('src'))
.set('root', resolve('./'))
.set('#', resolve('src/universal'))
.set('apis', resolve('src/main/apis'))
.set('@core', resolve('src/main/apis/core'))
config.resolve.mainFields
.clear()
.add('main') // fix some modules will use browser target
.add('module')
2019-12-19 06:17:21 -05:00
},
builderOptions: {
productName: 'PicList',
appId: 'com.kuingsmile.piclist',
afterSign: 'scripts/notarize.js',
2020-01-01 05:18:51 -05:00
publish: [
{
provider: 's3',
bucket: 'piclist-dl',
region: 'auto',
acl: 'private',
endpoint: 'https://7ab4ed5cb1f4052a13d3b573876ecf33.r2.cloudflarestorage.com',
path: '/latest'
},
2020-01-01 05:18:51 -05:00
{
provider: 'github',
owner: 'Kuingsmile',
repo: 'PicList',
2020-01-01 05:18:51 -05:00
releaseType: 'draft'
}
],
2019-12-19 06:17:21 -05:00
dmg: {
sign: false,
2019-12-19 06:17:21 -05:00
contents: [
{
x: 410,
y: 150,
type: 'link',
path: '/Applications'
},
{
x: 130,
y: 150,
type: 'file'
}
]
},
mac: {
icon: 'build/icons/icon.icns',
extendInfo: {
LSUIElement: 0
},
target: [{
2023-04-06 11:33:35 -04:00
target: 'default',
arch: [
'universal',
'x64',
'arm64'
]
}],
// eslint-disable-next-line no-template-curly-in-string
2023-04-06 17:19:16 -04:00
artifactName: 'PicList-${version}-${arch}.${ext}'
2019-12-19 06:17:21 -05:00
},
win: {
icon: 'build/icons/icon.ico',
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'PicList-Setup-${version}-${arch}.exe',
2023-04-08 06:31:22 -04:00
verifyUpdateCodeSignature: false,
target: [{
target: 'nsis',
arch: [
'x64',
'ia32'
]
}]
2019-12-19 06:17:21 -05:00
},
nsis: {
shortcutName: 'PicList',
2019-12-19 06:17:21 -05:00
oneClick: false,
allowToChangeInstallationDirectory: true,
include: 'build/installer.nsh'
2019-12-19 06:17:21 -05:00
},
linux: {
icon: 'build/icons/',
asarUnpack: [
'**/node_modules/sharp/**'
]
2020-01-01 05:18:51 -05:00
},
snap: {
publish: ['github']
2019-12-19 06:17:21 -05:00
}
}
}
}
}
if (process.env.NODE_ENV === 'development') {
config.configureWebpack = {
devtool: 'source-map'
}
// for dev main process hot reload
config.pluginOptions.electronBuilder.mainProcessWatch = ['src/main/**/*']
}
module.exports = {
...config
}