2020-11-06 10:59:54 +00:00
|
|
|
const path = require('path')
|
2020-11-12 09:59:34 +00:00
|
|
|
const webpack = require('webpack')
|
2021-08-17 14:54:04 +00:00
|
|
|
const publishUrl = process.env.VUE_APP_PUBLISH_URL
|
2021-08-18 02:30:54 +00:00
|
|
|
const publishProvider = process.env.VUE_APP_PUBLISH_PROVIDER
|
2021-08-17 16:59:49 +00:00
|
|
|
console.log('publish url', publishUrl)
|
2020-10-24 13:22:44 +00:00
|
|
|
module.exports = {
|
2020-11-09 10:58:14 +00:00
|
|
|
pages: {
|
|
|
|
index: {
|
|
|
|
entry: 'src/main.js',
|
2020-11-11 01:43:01 +00:00
|
|
|
title: 'DevSidecar-给开发者的边车辅助工具'
|
2020-11-09 10:58:14 +00:00
|
|
|
}
|
|
|
|
},
|
2021-08-18 08:33:46 +00:00
|
|
|
configureWebpack: (config) => {
|
2020-10-24 13:22:44 +00:00
|
|
|
const configNew = {
|
2020-11-12 09:59:34 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({ 'global.GENTLY': true })
|
|
|
|
],
|
2020-10-24 13:22:44 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.json5$/i,
|
|
|
|
loader: 'json5-loader',
|
|
|
|
options: {
|
|
|
|
esModule: false
|
|
|
|
},
|
|
|
|
type: 'javascript/auto'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return configNew
|
|
|
|
},
|
|
|
|
pluginOptions: {
|
|
|
|
electronBuilder: {
|
|
|
|
nodeIntegration: true,
|
|
|
|
// Provide an array of files that, when changed, will recompile the main process and restart Electron
|
|
|
|
// Your main process file will be added by default
|
|
|
|
mainProcessWatch: ['src/bridge', 'src/*.js', 'node_modules/dev-sidecar/src'],
|
|
|
|
builderOptions: {
|
2021-04-03 09:31:28 +00:00
|
|
|
afterPack: './pkg/after-pack.js',
|
2021-04-03 10:29:54 +00:00
|
|
|
afterAllArtifactBuild: './pkg/after-all-artifact-build.js',
|
2021-08-18 02:30:54 +00:00
|
|
|
// artifactBuildCompleted: './pkg/artifact-build-completed.js',
|
2021-04-03 09:23:22 +00:00
|
|
|
// builderOptions: {
|
|
|
|
// publish: ['github']// 此处写入github 就好,不用添加其他内容
|
|
|
|
// },
|
2020-10-24 13:22:44 +00:00
|
|
|
extraResources: [
|
|
|
|
{
|
2020-10-25 13:04:28 +00:00
|
|
|
from: 'extra',
|
|
|
|
to: 'extra'
|
2020-10-24 13:22:44 +00:00
|
|
|
}
|
2020-11-07 18:40:06 +00:00
|
|
|
],
|
|
|
|
appId: 'dev-sidecar',
|
2021-08-17 09:24:30 +00:00
|
|
|
productName: 'dev-sidecar',
|
2020-11-07 18:40:06 +00:00
|
|
|
// eslint-disable-next-line no-template-curly-in-string
|
2020-11-11 01:43:01 +00:00
|
|
|
artifactName: 'DevSidecar-${version}.${ext}',
|
2021-04-03 09:43:09 +00:00
|
|
|
copyright: 'Copyright © 2020-2021 Greper',
|
2020-11-07 18:40:06 +00:00
|
|
|
nsis: {
|
|
|
|
oneClick: false,
|
2020-11-11 01:55:32 +00:00
|
|
|
perMachine: true,
|
2020-11-07 18:40:06 +00:00
|
|
|
allowElevation: true,
|
2021-11-11 13:23:45 +00:00
|
|
|
allowToChangeInstallationDirectory: true,
|
|
|
|
include: './build/installer.nsh'
|
2020-11-07 18:40:06 +00:00
|
|
|
},
|
2021-01-10 04:42:25 +00:00
|
|
|
mac: {
|
2021-08-18 13:58:31 +00:00
|
|
|
icon: './build/mac/icon.icns',
|
2021-11-17 01:23:09 +00:00
|
|
|
target: {
|
|
|
|
arch: 'universal',
|
|
|
|
target: 'dmg'
|
|
|
|
}
|
2021-01-10 09:49:28 +00:00
|
|
|
},
|
2021-08-06 16:35:26 +00:00
|
|
|
win: {
|
2021-08-20 10:28:08 +00:00
|
|
|
icon: 'build/icons/'
|
|
|
|
// requestedExecutionLevel: 'highestAvailable' // 加了这个无法开机自启
|
2021-08-06 16:35:26 +00:00
|
|
|
},
|
2021-08-15 13:09:45 +00:00
|
|
|
linux: {
|
2021-08-17 10:57:22 +00:00
|
|
|
icon: 'build/mac/',
|
2021-08-15 13:09:45 +00:00
|
|
|
target: [
|
2021-08-18 07:00:05 +00:00
|
|
|
'deb',
|
2021-08-17 13:16:39 +00:00
|
|
|
'AppImage'
|
2021-08-15 13:09:45 +00:00
|
|
|
]
|
|
|
|
},
|
2020-11-09 10:58:14 +00:00
|
|
|
publish: {
|
2021-08-18 02:30:54 +00:00
|
|
|
provider: publishProvider,
|
2021-08-17 14:54:04 +00:00
|
|
|
url: publishUrl
|
2021-04-04 15:26:18 +00:00
|
|
|
// url: 'http://dev-sidecar.docmirror.cn/update/preview/'
|
2021-01-10 11:58:42 +00:00
|
|
|
}
|
2020-11-06 10:59:54 +00:00
|
|
|
},
|
|
|
|
chainWebpackMainProcess (config) {
|
|
|
|
config.entry('mitmproxy').add(path.join(__dirname, 'src/bridge/mitmproxy.js'))
|
2020-10-24 13:22:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|