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

  • 1.0.0
  • Source
  • npm
  • Socket score

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

metalsmith-browserify

npm version build status coverage status greenkeeper downloads

A metalsmith plugin to bundle javascript with browserify

This plugin allows you to bundle your javscript with browserify. Pass it the entry points it should bundle, and it will replace those files with the resulting bundle on build.

For support questions please use stack overflow or our slack channel. For browserify specific questions try their documentation.

Installation

$ npm install metalsmith-browserify

Options

You can pass options to metalsmith-browserify with the Javascript API or CLI. The options are:

  • entries: required. The entry points that need to be browserified. Accepts an array of strings.
  • browserifyOptions: optional. These options will be passed on to browserify. See this area of the browserify documentation for all available options. Note that it's possible to break stuff here, like overriding the entries, so use wisely.

entries

The entry points that should be browserified. So this metalsmith.json:

{
  "source": "src",
  "destination": "build",
  "plugins": {
    "metalsmith-browserify": {
      "entries": [
        "index.js",
        "another.js"
      ]
    }
  }
}

Would browserify both ./src/index.js and ./src/another.js and output them as ./build/index.js and ./build/another.js respectively.

browserifyOptions

Use this to pass options to browserify. So this metalsmith.json:

{
  "source": "src",
  "destination": "build",
  "plugins": {
    "metalsmith-browserify": {
      "entries": ["index.js"],
      "browserifyOptions": {
        "debug": true
      }
    }
  }
}

Would enable browserify's debug option and add a source map to the bundle.

Errors and debugging

If you're encountering problems you can use debug to enable verbose logging. To enable debug prefix your build command with DEBUG=metalsmith-browserify. So if you normally run metalsmith to build, use DEBUG=metalsmith-browserify metalsmith (on windows the syntax is slightly different).

License

MIT

Keywords

FAQs

Package last updated on 27 Feb 2018

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