----使用electron-builder打包(需要魔法)
--安裝electron-builder:
npm install electron-builder -D
?--package.json中進行相關配置:
{"name": "video-tools","version": "1.0.0","main": "main.js","scripts": {"start": "electron .","build": "electron-builder"},"build": {"appId": "com.atguigu.video","win": {"icon": "./logo.ico","target": [{"target": "nsis","arch": ["x64"]}]},"nsis": {"oneClick": false,"perMachine": true,"allowToChangeInstallationDirectory": true}},"devDependencies": {"electron": "^30.0.0","electron-builder": "^24.13.3"},"author": "xmr","license": "ISC","description": "A video processing program based on Electron"
}
----使用Electron Forge進行打包(推薦,無需魔法)
中文網也是用這個?
--執行第一條命令:
npm install --save-dev @electron-forge/cli
--執行第二條命令:
npx electron-forge import
--執行第三條命令:
npm run make
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?這就打包成功啦!!!
--運行程序的路徑:
可運行程序在?my-electron-app\out\make\squirrel.windows\x64