dev-sidecar/packages/gui/vue.config.js

115 lines
3.5 KiB
JavaScript
Raw Normal View History

2024-11-18 17:41:53 +00:00
const path = require('node:path')
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
2024-04-02 04:35:39 +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',
title: 'DevSidecar-给开发者的边车辅助工具',
},
2020-11-09 10:58:14 +00:00
},
lintOnSave: false,
2024-11-15 10:02:36 +00:00
configureWebpack: {
plugins: [
new webpack.DefinePlugin({ 'global.GENTLY': true }),
],
module: {
rules: [
{
test: /\.json5$/i,
loader: 'json5-loader',
options: {
esModule: false,
},
2024-11-15 10:02:36 +00:00
type: 'javascript/auto',
},
],
},
2020-10-24 13:22:44 +00:00
},
pluginOptions: {
electronBuilder: {
externals: [
'@mihomo-party/sysproxy',
'@mihomo-party/sysproxy-win32-ia32-msvc',
'@mihomo-party/sysproxy-win32-x64-msvc',
'@mihomo-party/sysproxy-win32-arm64-msvc',
'@mihomo-party/sysproxy-linux-x64-gnu',
'@mihomo-party/sysproxy-linux-arm64-gnu',
'@mihomo-party/sysproxy-darwin-x64',
'@mihomo-party/sysproxy-darwin-arm64',
'@natmri/platform-napi',
'@natmri/platform-napi-win32-ia32-msvc',
'@natmri/platform-napi-win32-x64-msvc',
'@natmri/platform-napi-win32-arm64-msvc',
'@natmri/platform-napi-linux-x64-gnu',
'@natmri/platform-napi-linux-x64-musl',
'@natmri/platform-napi-linux-arm64-gnu',
'@natmri/platform-napi-linux-arm64-musl',
'@natmri/platform-napi-linux-arm-gnueabihf',
'@natmri/platform-napi-darwin-x64',
'@natmri/platform-napi-darwin-arm64',
],
2020-10-24 13:22:44 +00:00
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-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}',
2024-04-26 02:53:43 +00:00
copyright: 'Copyright © 2020-2024 Greper, WangLiang',
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
},
win: {
icon: 'build/icons/',
// requestedExecutionLevel: 'highestAvailable' // 加了这个无法开机自启
},
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',
'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,
url: publishUrl,
2021-04-04 15:26:18 +00:00
// url: 'http://dev-sidecar.docmirror.cn/update/preview/'
},
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
}