Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-platform-overrides with all npm packages installed. Try it out:

var gulpPlatformOverrides = require("gulp-platform-overrides")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-platform-overrides v1.0.0

A Gulp plugin for applying platform-specific manifest values

gulp-platform-overrides NPM version Build Status Dependency Status

A Gulp plugin for applying platform-specific manifest values. Simply a Gulp wrapper for platform-overrides.

Installation

npm install gulp-platform-overrides

Usage

var gulp = require('gulp');
var platformOverrides = require('gulp-platform-overrides');

gulp.task('prepare', function() {
    gulp.src('./package.json')
        .pipe(platformOverrides({platform: 'osx'}) // if platform is missing, then it is auto-detected
        .pipe(gulp.dest('./dist'));
});

gulp.task('default', ['prepare']);

Options

The options are the same as platform-overrides, except the options property (the manifest) isn't supported as it is passed down the stream here.

Issues

Please report any issues at platform-overrides.

Example

Example manifest:

{
  "name": "nw-demo",
  "version": "0.1.0",
  "main": "index.html",
  "window": {
      "frame": false,
      "toolbar": false
  },
  "platformOverrides": {
      "win": {
          "window": {
              "frame": true
          }
      },
      "osx": {
          ...
      },
      "linux32": {
          ...
      },
      "linux64": {
          ...
      },
  }
}

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
    }
}

Contributing

See CONTRIBUTING.md

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free