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

metalsmith-browserify

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-browserify

Metalsmith plugin to bundle JS with browserify

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Metalsmith - Browserify

Metalsmith plugin to bundle JS with browserify

Installation

npm install metalsmith-browserify --save

metalsmith-browserify does not bundle browserify. You need to install it yourself in your package. This is to avoid usage of an outdated browserify version with metalsmith-browserify.

Usage

var metalsmith = require('metalsmith');
var browserify = require('metalsmith-browserify');

metalsmith(__dirname)
  .use(browserify({
    dest: 'js/bundle.js',
    entries: ['./src/js/index.js'],
    sourcemaps: false,
    watch: false
  }))
  .build(function (err, files) {
    if (err) {
      throw err;
    }
  });

See browserify api for available options.

If you need to manipulate the created browserify bundle do:

var metalsmith = require('metalsmith');
var browserify = require('metalsmith-browserify');

var b = browserify({
  dest: 'js/bundle.js',
  entires: ['./src/js/index.js']
);

// do stuff with the bundle
b.bundle.external(/*...*/);

metalsmith(__dirname)
  .use(b) // use the plugin
  .build()

It can also be used with metalsmith.json by adding the plugin like this:

{
  "plugins": {
    "metalsmith-browserify": {
      "dest": "javascripts/bundle.js",
      "entries": ["src/javascripts/index.js"],
      "sourcemaps": false,
      "watch": false
    }
  }
}

Or assume the defaults (dest: bundle.js, args: []):

{
  "plugins": {
    "metalsmith-browserify": true
  }
}

Keywords

FAQs

Package last updated on 16 Dec 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

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