在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):nwutils/nw-builder开源软件地址(OpenSource Url):https://github.com/nwutils/nw-builder开源编程语言(OpenSource Language):JavaScript 99.9%开源软件介绍(OpenSource Introduction):nw-builderBuild NW.js applications for Mac, Windows and Linux. Table of ContentsInstallation
Using npm: npm install nw-builder Using yarn: yarn add nw-builder Using pnpm: pnpm add nw-builder UsageCLInwbuild ./path/to/app Moduleconst { nwbuild } = require("nw-builder");
nwbuild({
files: "./path/to/app",
platforms: ["linux64", "win32"],
});
API Reference
Methodsnwbuild(options, callbacks)The function that setups up, runs and builds your NW.js applications. The Optionsoptions.modeType: Specify if you want to run or build your app. options.quietType: Choose your level of logging between error, warn, info, debug and off. options.files RequiredType: The path to your node webkit app. It supports simple-glob so you can do stuff like options.versionType: The version of NW.js you want to use. Per default it looks up the latest version. Here is a list of all available releases. options.flavorType: The flavor of NW.js you want to use. Per default it will be The value options.platformsType The platforms you want to build. Can be The values Be aware that the osx32 version can only be built with legacy version of nwjs. Since > 0.12.0, only 64 bits for osx works. options.appNameType: The Name of your NW.js app. If this value is set to null, it will autodetect the options.appVersionType: The version of your NW.js app. If this value is set to null, it will autodetect the options.buildDirType: This is where the releases are saved. options.cacheDirType: This is where the cached NW.js downloads are. options.buildTypeType: How you want to save your build.
options.forceDownloadType: This will delete everything in your options.argvType Pass Command Line Options when you run an NW.js instance. Ignored in case of build. options.macCreditsType: MAC ONLY: The path to your credits.html file. If your don't provide your own it will use the one provided by NW.js options.macIcnsType: MAC ONLY: The path to your ICNS icon file. If your don't provide your own it will use the one provided by NW.js options.zipType: WINDOW ONLY: Instead of zipping the application and merging it into the executable the application content is placed next to the application (which speed up the startup time for large apps). The default behaviour is platform specific. For options.zipOptionsType: Allows to configure the underling zip library parameters, like store or compression ratio. See archiver documentation for detailed description of properties. options.macPlistType: MAC ONLY: Pass a string containing the path to your own plist file. If a string isn't passed, a plist file will be generated from your package.json. Pass an object to overwrite or add properties to the generated plist file. options.winVersionStringType: WINDOWS ONLY: Some descriptors of the executable. If your don't provide your own See the MSDN docs for more options than the basic list below,
options.winIcoType: WINDOWS ONLY: The path to your ICO icon file. If your don't provide your own it will use the one provided by NW.js. If you are building on MAC or LINUX you must have Wine installed to use this option. options.macZip (DEPRECATED)Type: MAC ONLY: Use a options.mergeZipType: WINDOWS AND LINUX ONLY: Merge the source file package with the Node Webkit executable. Manifest OptionsplatformOverridesAllows you to specify platform-specific manifest values. Example manifest: {
"name": "nw-demo",
"version": "0.1.0",
"main": "index.html",
"window": {
"frame": false,
"toolbar": false
},
"platformOverrides": {
"win": {
"window": {
"toolbar": true
}
},
"win32": {
"window": {
"frame": true,
"toolbar": false
}
},
"win64": {
"window": {
"frame": true
}
},
"osx": {
...
},
"osx32": {
...
},
"osx64": {
...
},
"linux": {
...
},
"linux32": {
...
},
"linux64": {
...
},
}
The platform-specific options will override the others only when building that platform only and the For example, when building for Windows, the manifest generated and put into the end app (from the manifest above) would be: {
"name": "nw-demo",
"version": "0.1.0",
"main": "index.html",
"window": {
"frame": true,
"toolbar": false
}
} Additionally, when specifying multiple version of the same platform such as "win", "win32", and "win64", changes will be applied such that "win" applies to both "win32" and "win64", while "win32" and "win64" apply only to the specified version. Also note that "win32" and "win64" can further override changes made in "win". See #85 and #94 for more information. If you need this during development too, see platform-overrides and gulp-platform-overrides. There is no Grunt plugin, yet. ## Troubleshooting OSX ulimitDarwin (OS X kernel) has a low limit for file descriptors (256 per process) by default, so you might get an To get around it, run TeamThis project was created by Steffen Müller and has been maintained by Gabe Paez, Andy Trevorah, Adam Lynch and Rémy Boulanouar in the past. This project is currently maintained by Ayushman Chhabra. ContributingGetting Started
General Guidelines
License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论