fast browserify transform for ES modules, and nothing else--using @WebReflection ascjs
npm install ascjsify
browserify app.js -t ascjsify
browserify app.js -g ascjsify # global
var ascjsify = require('ascjsify')
var b = browserify()
b.transform(ascjsify, { global: true })
global: true
is optional, but useful if dependencies may be using ES modules already.
ascjsify
only runs on files that look like they may contain import
or export
statements, so it won't slow everything down when run globally.
import { EventEmitter } from 'events'
export default new EventEmitter()
const { EventEmitter } = require('events')
Object.defineProperty(exports, '__esModule', {value: true}).default = new EventEmitter()