npm-installer
npm-installer copied to clipboard
How to download sdk and normal version to node modules ?
I want to implement simple gulp task to run app in SDK mode:
const debugRun = gulpfile.series(debug_run);
gulpfile.task('debug-run', debugRun);
function debug_run() {
process.env.NWJS_BUILD_TYPE = 'sdk';
log(nw.findpath())
}
But I can't download both normal and sdk via:
npm install -D [email protected]
npm install -D [email protected]
because they replace each other
@Arti3DPlayer
package.json
{
"name": "example",
"version": "1.0.0",
"description": "example",
"main": "index.html",
"scripts": {
"start": "nw .",
"build": "build --concurrent --tasks win-x86,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
"normal": "run --x86 --mirror https://dl.nwjs.io/ ."
},
"devDependencies": {
"nw": "sdk",
"nwjs-builder-phoenix": "1.x.x"
},
"build": {
"nwVersion": "latest",
"nwFlavor": "normal",
"targets": [
"zip",
"nsis7z"
],
"excludes": [
"package-lock.json",
"assets/*",
"src/sass/*"
],
"strippedProperties": [
"scripts",
"devDependencies",
"build"
],
"win": {
"icon": "assets/icon.ico"
},
"mac": {
"icon": "assets/icon.icns"
},
"nsis": {
"icon": "assets/icon.ico",
"unIcon": "assets/icon.ico",
"languages": [
"English"
],
"diffUpdaters": false,
"hashCalculation": true
}
}
}
With this set up you can do:
-
npm installand have the latest SDK and Normal versions downloaded/installed innode_modules. -
npm startto run the SDK version locally. -
npm run normalto run the Normal version locally. -
npm run buildto produce builds for each platform.
See: https://github.com/evshiron/nwjs-builder-phoenix for more details.