Registry / web-framework / browserify-es6-modules

browserify-es6-modules

JSON →
library0.1.1jsnpmunverified

A Browserify transform that compiles ES6 module syntax (import/export) to CommonJS using the ES6 Module Transpiler. Version 0.1.1 is the latest release; no updates since 2014. This project is experimental (WIP) and superseded by Babel. Designed for early adopters of ES6 modules in Browserify builds, but now obsolete. Not recommended for new projects.

npm install browserify-es6-modules
INSTALL
IMPORT
SIG · BROWSERIFY-ES6-MOD
B
browserify-es6-modules
web-frameworkjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (transform function)
module.exports = require('browserify-es6-modules');
import transform from 'browserify-es6-modules';
Package does not support ES modules; use CommonJS require.
Transform usage in package.json or gulp
browserify().transform('browserify-es6-modules');
browserify().transform(require('browserify-es6-modules'));
Browserify resolves transform names; passing function may cause issues.
Stream interface
var through = require('through2'); var tr = through();
var tr = new require('browserify-es6-modules')();
Uses through2 internally; not instantiated directly.

Shows how to apply the transform in a Browserify build script.

// Install: npm install browserify-es6-modules es6-module-transpiler // In your build script: var browserify = require('browserify'); var b = browserify(); b.transform('browserify-es6-modules'); b.add('./entry.js'); b.bundle().pipe(process.stdout); // Then run the script with Node.
Debug
Known issues
deprecatedThis package is unmaintained and superseded by Babel. Do not use in new projects.
fix
Use Babel with babelify transform instead.
affects: >=0.0.0
breakingExperimental (WIP) – may not correctly transpile all ES6 module syntax.
fix
Test your code thoroughly or switch to a mature alternative.
affects: >=0.0.0
gotchaRequires es6-module-transpiler to be installed separately; not listed as a dependency in package.json.
fix
Explicitly install es6-module-transpiler alongside this package.
affects: >=0.0.0
Errors
Common errors & fixes
TransformError: .../node_modules/browserify-es6-modules/index.js: ... is not a function
The transform is applied incorrectly (e.g., calling it as a function instead of passing a string).
fix
Use b.transform('browserify-es6-modules') not b.transform(require('...')).
Module not found: es6-module-transpiler not installed
Missing peer dependency es6-module-transpiler.
fix
Run: npm install es6-module-transpiler
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
browserifyoptionalrequired as a transform for Browserify
es6-module-transpilerrequiredcore compilation logic
Agent activity
13 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
browserify-es6-modules — npm install browserify-es6-modules · libregistry