feat: ♥ 生产版本构建

pull/6/head
caorushizi 4 years ago
parent d512d78291
commit a6bfa0daa8

@ -41,9 +41,7 @@ app.on("activate", async () => {
app.whenReady().then(async () => {
protocol.registerFileProtocol("mediago", (request, callback) => {
const url = request.url.substr(10);
console.log("url: ", url);
console.log("after: ", resolve(__dirname, "../electron", url));
callback({ path: resolve(__dirname, "../electron", url) });
callback({ path: resolve(__dirname, "../", url) });
});
await init();

@ -8,8 +8,8 @@ const windowList = new Map<WindowName, IWindowListItem>();
windowList.set(WindowName.MAIN_WINDOW, {
url: is.development
? "mediago://main_window.html"
: "mediago://main_window.html",
? "http://localhost:3000/main_window.html"
: "mediago://electron/main_window.html",
options() {
return {
width: 590,
@ -30,8 +30,8 @@ windowList.set(WindowName.MAIN_WINDOW, {
windowList.set(WindowName.BROWSER_WINDOW, {
url: is.development
? "mediago://browser_window.html"
: "mediago://browser_window.html",
? "http://localhost:3000/browser_window.html"
: "mediago://electron/browser_window.html",
options() {
return {
width: 800,

@ -1,5 +1,5 @@
{
"name": "vite-project-1",
"name": "media-downloader",
"version": "0.0.0",
"description": "在线视频下载",
"author": "caorushizi",
@ -10,7 +10,7 @@
"electron": "cross-env NODE_ENV=development node esbuild.config.js && electron dist/main/index.js",
"prestart": "script/prestart",
"start": "concurrently -n=vite,electron -c=green,blue \"npm run dev\" \"npm run electron\"",
"build": "tsc && vite build",
"build": "tsc && vite build && node esbuild.config.js",
"serve": "vite preview",
"pack": "electron-builder --dir",
"dist": "electron-builder"
@ -58,20 +58,19 @@
"vite": "^2.1.0"
},
"build": {
"productName": "xxxx",
"appId": "com.xxx.xxxxx",
"copyright": "xxxx",
"productName": "在线视频下载",
"appId": "mediago.ziying.site",
"copyright": "caorushizi",
"directories": {
"output": "build"
},
"files": [
"dist/electron",
"dist/main",
"node_modules/",
"package.json"
],
"win": {
"icon": "build/icons/aims.ico",
"icon": "",
"target": [
{
"target": "nsis"
@ -92,14 +91,14 @@
"oneClick": false,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"installerIcon": "./build/icons/aaa.ico",
"uninstallerIcon": "./build/icons/bbb.ico",
"installerHeaderIcon": "./build/icons/aaa.ico",
"installerIcon": "",
"uninstallerIcon": "",
"installerHeaderIcon": "",
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"shortcutName": "xxxx",
"include": "build/script/installer.nsh",
"script": "build/script/installer.nsh"
"include": "",
"script": ""
}
}
}

@ -6,6 +6,7 @@ import { resolve } from "path";
export default defineConfig({
plugins: [reactRefresh()],
build: {
target: "es2015",
rollupOptions: {
input: {
main: resolve(__dirname, "main_window.html"),

Loading…
Cancel
Save