Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
broccoli-es6-npm-compiler
Advanced tools
Broccoli plugin that compiles ES6 modules along with npm dependencies into a single UMD bundle using Browserify. The plugin looks for the jsnext:main
property in your package.json, compiles any ES6 modules to CommonJS modules, browserifies them, and saves the whole thing as single file based on the main
property of the package.json.
For importing npm modules in your ES6 code, use the npm:
prefix. For instance, if you wanted to use the RSVP promise library, you would import it like so:
import npmModule from 'npm:rsvp';
// Use regular syntax for local modules
import myLocalModule from './lib/my-local-module';
This prefix, as well as the entire plugin, was inspired by ember-browserify.
Let's say your package.json looks something like this:
// package.json
{
"name": "MyModule",
"main": "exports/my-module.js",
"jsnext:main": "lib/index.js",
//...
}
Now just add this to your Brocfile:
//Brocfile.js
var compileEs6 = require('broccoli-es6-npm-compiler');
var options = {
globalName: 'MyLibrary',
amdModuleId: 'MyLibrary'
};
var outputTree = compileEs6(options);
Yea, it's that simple. Using lib/index.js
as the root ES6 module, the plugin will bundle your ES6 code into a file named my-module.js
in the dist output folder when you run Broccoli.
globalName - Name of global module variable exported via UMD. In other words, window[globalName]. Defaults to name
in package.json
.
amdModuleId - Module ID of exported AMD module. If undefined, AMD module will be anonymous.
FAQs
Compile ES6 modules along with npm dependencies
The npm package broccoli-es6-npm-compiler receives a total of 15 weekly downloads. As such, broccoli-es6-npm-compiler popularity was classified as not popular.
We found that broccoli-es6-npm-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.