Browserify ES6 Module Transpiler

raw JSON →
0.1.1 verified Fri May 01 auth: no javascript deprecated

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.

error TransformError: .../node_modules/browserify-es6-modules/index.js: ... is not a function
cause 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('...')).
error Module not found: es6-module-transpiler not installed
cause Missing peer dependency es6-module-transpiler.
fix
Run: npm install es6-module-transpiler
deprecated This package is unmaintained and superseded by Babel. Do not use in new projects.
fix Use Babel with babelify transform instead.
breaking Experimental (WIP) – may not correctly transpile all ES6 module syntax.
fix Test your code thoroughly or switch to a mature alternative.
gotcha Requires es6-module-transpiler to be installed separately; not listed as a dependency in package.json.
fix Explicitly install es6-module-transpiler alongside this package.
npm install browserify-es6-modules
yarn add browserify-es6-modules
pnpm add browserify-es6-modules

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.