PicList/vue.config.js

108 lines
2.5 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 arch = process.argv.includes('--ia32') ? 'ia32' : 'x64'
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: ['picgo'],
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'))
2019-12-19 06:17:21 -05:00
},
builderOptions: {
productName: 'PicGo',
appId: 'com.molunerfinn.picgo',
2020-01-01 05:18:51 -05:00
publish: [
{
provider: 'github',
owner: 'Molunerfinn',
repo: 'PicGo',
releaseType: 'draft'
}
],
2019-12-19 06:17:21 -05:00
dmg: {
contents: [
{
x: 410,
y: 150,
type: 'link',
path: '/Applications'
},
{
x: 130,
y: 150,
type: 'file'
}
]
},
mac: {
icon: 'build/icons/icon.icns',
extendInfo: {
LSUIElement: 1
}
},
win: {
icon: 'build/icons/icon.ico',
// eslint-disable-next-line no-template-curly-in-string
artifactName: `PicGo Setup \${version}-${arch}.exe`,
target: [{
target: 'nsis',
arch: [
arch
]
}]
2019-12-19 06:17:21 -05:00
},
nsis: {
shortcutName: 'PicGo',
oneClick: false,
allowToChangeInstallationDirectory: true
},
linux: {
icon: 'build/icons/'
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
}