šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

build-bin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-bin

A zero-configuration plugin system for building assets for production release

0.0.8
latest
Source
npm
Version published
Weekly downloads
4
-60%
Maintainers
1
Weekly downloads
Ā 
Created
Source

build-bin

Build Status

A zero-configuration plugin system for building assets for production release

Installing

build-bin is available as an npm package.

Usage

Add build-bin to the package.json as follows:

{
  "name": "project",
  "private": true,
  "scripts": {
    "build": "build"
  },
  "devDependencies": {
    "build-bin": "^0.0.2"
  }
}

Then add plugins for each desired build workflow. Existing plugins are listed below.

From the command line, run:

npm run build

Plugins

  • build-html compiles and minifies an HTML entry point.
  • build-esnext compiles, concatenates, and minifies ES.next modules.
  • build-gzip gzips all static assets after compilation.
  • build-cloudfoundry configures a static frontend for deployment on Cloud Foundry.
  • build-heroku configures a static frontend for deployment on Heroku.

Writing Plugins

Plugins must have a name that starts with build- and declare a stage in package.json. Valid stages include compile, compress, and config. All plugins from the compile stage are run first, followed by plugins in the compress stage, and finally, followed by plugins in the config stage.

{
  "name": "build-esnext",
  "stage": "compile",
  "main": "src/index.js"
}

Plugins must export a function or async function and must write into the dist directory.

import {fs} from 'node-promise-es6';

export default async function() {
  await fs.writeFile('dist.js', 'console.log("Hello World!");');
}

Development

Getting Started

The application requires the following external dependencies:

  • Node.js

The rest of the dependencies are handled through:

npm install

Run tests with:

npm test

Keywords

assets

FAQs

Package last updated on 26 Aug 2016

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