2019-12-19 06:17:21 -05:00
|
|
|
const path = require('path')
|
|
|
|
function resolve (dir) {
|
|
|
|
return path.join(__dirname, dir)
|
|
|
|
}
|
2021-03-28 05:44:07 -04:00
|
|
|
|
|
|
|
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: {
|
2019-12-20 05:46:39 -05:00
|
|
|
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'))
|
2020-04-10 11:28:46 -04:00
|
|
|
.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',
|
|
|
|
target: 'nsis'
|
|
|
|
},
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-28 05:44:07 -04:00
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
config.configureWebpack = {
|
|
|
|
devtool: 'eval-source-map'
|
|
|
|
}
|
2021-04-05 04:09:27 -04:00
|
|
|
// for dev main process hot reload
|
|
|
|
config.pluginOptions.electronBuilder.mainProcessWatch = ['src/main/**/*']
|
2021-03-28 05:44:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
...config
|
|
|
|
}
|