Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

builder-target

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

builder-target

build target plugin for component-builder

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

builder-target

target build plugin for component-builder2.

Example

component.json

Let's say you have the following component, and you want to build

  • one bundle for the web that use api.js
  • another one for your native app that use api.cordova.js

You can define a new section in your component.json (here we name it cordova) and use the plugin by calling .use('scripts', target('cordova'))

{
  "cordova": {
    "api.js": "api.cordova.js"
  },
  "scripts": [
    "index.js",
    "api.js"
  ],
  "main": "index.js"
}
var fs = require('fs');
var build = require('component-builder');
var target = require('builder-target');

// build web bundle
build.scripts(nodes)
  .use('scripts', build.plugins.js())
  .build(function (err, string) {
    if (err) throw err;
    fs.writeFileSync('build.js', string);
  })

// build cordova bundle
build.scripts(nodes)
  .use('scripts', build.plugins.js())
  .use('scripts', target('cordova'))
  .build(function (err, string) {
    if (err) throw err;
    fs.writeFileSync('build.js', string);
  })

License

The MIT License (MIT)

FAQs

Package last updated on 05 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc