New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bfred-npm-bundler

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bfred-npm-bundler

Opinionated ES6 library bundler based on rollup-babel-lib-bundler. For my own modules, but maybe you can find it useful too.

  • 5.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35
increased by191.67%
Maintainers
1
Weekly downloads
 
Created
Source

bfred-npm-bundler

Opinionated ES6 library bundler based on rollup-babel-lib-bundler. For my own modules, but maybe you can find it useful too.

The difference with rollup-babel-lib-bundler is that this is already configured for the output of the following files:

  • dist/[lib-name].browser.js
    A minified file for the browser with a global called [libName]
  • dist/[lib-name].common-js.js
    A file to be used with browserify or similar. Set it up with:
    "main": "dist/[lib-name].common-js.js", in package.json
  • dist/[lib-name].es-modules.js
    A file to be used with ESM-aware bundlers like rollup. Set it up with:
    "jsnext:main": "dist/[lib-name].es-modules.js", in package.json

Usage

Install it in your project together with a rollup-compatible babel preset:

npm install --save-dev bfred-npm-bundler babel-preset-es2015-rollup

Add the references to the generated files, the babel config, and the build step in your package.json:

{
	"main": "dist/lib-name.common-js.js",
	"jsnext:main": "dist/lib-name.es-modules.js",
	"babel": {
		"presets": [
			"es2015-rollup"
		]
	},
	"scripts": {
		"build": "bfred-npm-bundler lib-name libName",
		"prepublish": "npm run build"
	}
}

Node-only

If your lib only makes sense inside node/browserify, you can skip the browser file creation by not passing the second argument:

bfred-npm-bundler lib-name instead of bfred-npm-bundler lib-name libName

FAQs

Package last updated on 28 Mar 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