From 4ac8a08ca2d4dc204bc54696a25133db4bfad5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Mon, 17 Aug 2020 09:16:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=89=93=E5=8C=85=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 44 +++++++++++++++++++++++++++++++++++------ script/rollup.config.js | 5 ++++- src/render/App.vue | 2 +- vite.config.ts | 1 + 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index c00b186..b7f9910 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,43 @@ "license": "MIT", "scripts": { "dev": "npm run dev:all", - "dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run vue:dev\" \"npm run ele:dev\"", - "vue:dev": "vite", - "vue:build": "vite build", - "ele:build": "node script/build --env=production", - "ele:dev": "node script/build --env=development --watch" + "dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run dev:vue\" \"npm run dev:ele\"", + "dev:vue": "vite", + "dev:ele": "node script/build --env=development --watch", + "build:vue": "vite build", + "build:ele": "node script/build --env=production", + "build": "npm run build:vue && npm run build:ele && electron-builder" + }, + "build": { + "appId": "308487730@qq.com", + "files": [ + "!node_modules", + "src/main/**", + "src/render/dist/**" + ], + "mac": { + "artifactName": "${productName}_setup_${version}.${ext}", + "target": [ + "dmg" + ] + }, + "win": { + "target": [ + { + "target": "nsis", + "arch": [ + "x64" + ] + } + ], + "artifactName": "${productName}_setup_${version}.${ext}" + }, + "nsis": { + "oneClick": false, + "perMachine": false, + "allowToChangeInstallationDirectory": true, + "deleteAppDataOnUninstall": false + } }, "dependencies": { "vue": "^3.0.0-rc.1" @@ -39,4 +71,4 @@ "vue3", "rollup" ] -} +} \ No newline at end of file diff --git a/script/rollup.config.js b/script/rollup.config.js index 1cdbb67..8da946e 100644 --- a/script/rollup.config.js +++ b/script/rollup.config.js @@ -20,8 +20,11 @@ module.exports = (env = 'production') => { external: [ 'fs', 'path', + 'http', + 'https', + 'child_process', + 'os', 'electron', - 'electron-is-dev', ], } }; diff --git a/src/render/App.vue b/src/render/App.vue index be70e71..12d83b4 100644 --- a/src/render/App.vue +++ b/src/render/App.vue @@ -3,7 +3,7 @@ Electron logo Vue logo - +