Babel browserify transform that compiles JavaScript files using Babel during browserify bundling. Current stable version is 10.0.0, released on an as-needed basis. Supports Babel 7 with @babel/core as a peer dependency. Differentiates from other Babel integrations by tight coupling with browserify's transform pipeline, allowing per-file compilation with source maps and custom file extensions. Requires user-supplied presets/plugins for any transformation since Babel 6.
npm install babelifyVerified import paths — ran on the pinned version, not inferred.
Shows how to set up babelify with browserify, using configure() and specifying presets for ES6+ and React JSX.
Install @babel/core instead of babel-core. Update presets/plugins to @babel/* scope.
Install presets like @babel/preset-env and specify them in options.
Upgrade babelify to v10 and switch to @babel/core.
Prefer using the string name 'babelify' in transform() to avoid context issues.
Pass a RegExp object, e.g., /node_modules/.
Run 'npm install --save-dev @babel/core'
Install @babel/core v7 and remove babel-core.
Add presets like @babel/preset-env and @babel/preset-react to babelify options.