当前位置:网站首页>Electronic package to generate EXE file
Electronic package to generate EXE file
2022-06-25 19:04:00 【Ah, my goose one five and】
packaging 1:DOS Window command packaging
DOS Next , Input npm install electron-packager -g Global installation Our packing artifact :
cnpm install electron-packager -gUnder the project folder , That is, open under the root directory DOS Execute package command :
electron-packager . HelloWorld --platform=win32 --arch=x64 --icon=computer.ico --out=./out --asar --app-version=0.0.1 --overwrite --ignore=node_modules --electron-version 5.0.0Introduction of each parameter :
HelloWorld : You're going to generate exe The name of the document --platform=win32: Determine which platform of application you want to build , The desirable value is darwin, linux, mas, win32
--arch=x64: Decide to use x86 still x64 Or both architectures --icon=computer.ico: Custom settings apply icon --out=./out: Specify the folder location for the output of the package file , The currently specified is... Under the project directory out Folder
--asar: This parameter can be omitted , If you add , After packaging, the source code of the application will be .asar Format exists , Otherwise, it will exist as a folder --app-version=0.0.1: Generate the version number of the application --overwrite: Cover the original build, Let the newly generated package overwrite the original package
--ignore=node_modules: If you add this parameter , In the project node_modules Modules are not packaged --electron-version 5.0.0: Specify the currently to be built electron Version of , It needs to be consistent with the current version , The details can be found in package.json View in file , This parameter can be omitted , If it's not consistent , Will automatically download ,,, Don't suggest
packaging 2:package.json Set packaging :
It is recommended to set the packaged command in package.json Of script in
Set as follows :
"scripts": {"package":"electron-packager . HelloWorld --platform=win32 --arch=x64 --icon=computer.ico --out=./out --asar --app-version=0.0.1 --overwrite --ignore=node_modules"
}Then in the project folder DOS Execute the command window :
npm run packageYou can pack it successfully
边栏推荐
猜你喜欢
![Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]](/img/16/ab5056dd26cf7b1a761a92eea46e54.jpg)
Analysis of global tea production, consumption and import and export trade: China's tea production ranks first in the world [figure]

Elastic high-performance computing on the cloud supports the rapid development of the life science industry, reducing costs and increasing efficiency

Kotlin compose terminate todo project Click to edit and modify todo

How to quickly close port 8080

Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall

Detailed explanation of oauth2 - Introduction (I)
![[today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code](/img/ef/a26127284fe57ac049a4313d89cf97.png)
[today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code

Addition, deletion, modification and query of mysql~ tables (detailed and easy to understand)

云上弹性高性能计算,支持生命科学产业高速发展、降本增效

Kotlin Compose 终结toDo项目 点击可以编辑修改todo
随机推荐
TCP/IP 测试题(二)
2021 development status of China's cloud game industry and analysis of major service providers: Although cloud games are still in their infancy, the market prospect is huge [figure]
Development status of China's hydrotalcite industry in 2020 and analysis of major enterprises: the market scale is rapidly increasing, and there is a large space for domestic substitution [figure]
想知道新股民怎样炒股票开户?在线开户安全么?
焕新出发,利尔智达天下
Solve the problem that sublime Text3 package control cannot install plug-ins
Solidity date tool
JVM | runtime data area (heap space)
Training of long and difficult sentences in postgraduate entrance examination day89
SVN介绍及使用总结
Network security detection and prevention test questions (V)
MySQL view explanation
TCP/IP 测试题(一)
Redis6
利尔达蓝牙空调接收器方案助力打造更舒适的公路生活
PHP数据库连接version1.1
LeetCode 3. Longest substring without repeated characters & sliding window
Comparison rules of strings in JS
Leetcode-101-symmetric binary tree
Analysis of China's medical device industry development environment (PEST) in 2021: the awareness of medical care is enhanced, and the demand for medical device products is also rising [figure]