npm-installer icon indicating copy to clipboard operation
npm-installer copied to clipboard

How to download sdk and normal version to node modules ?

Open Arti3DPlayer opened this issue 7 years ago • 1 comments

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 avatar Jul 12 '18 11:07 Arti3DPlayer

@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 install and have the latest SDK and Normal versions downloaded/installed in node_modules.
  • npm start to run the SDK version locally.
  • npm run normal to run the Normal version locally.
  • npm run build to produce builds for each platform.

See: https://github.com/evshiron/nwjs-builder-phoenix for more details.

TheJaredWilcurt avatar Jul 12 '18 13:07 TheJaredWilcurt