Registry / babel-preset-next

babel-preset-next

JSON →
library1.4.0jsnpmunverified

A Babel preset that includes plugins for async generator functions, class properties, object rest spread, and decorators, targeting Babel 7.0 and requiring @babel/core and babel-loader 8.0+. Version 1.4.0 is the latest release, with modest updates to Babel dependencies. This preset is minimal and opinionated, primarily intended for personal or small projects, and not widely adopted. It differs from more comprehensive presets like @babel/preset-env by offering a fixed set of plugins without dynamic targeting or polyfilling.

npm install babel-preset-next
INSTALL
IMPORT
SIG · BABEL-PRESET-NEXT
B
babel-preset-next
javascriptv1.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
module.exports = { presets: ['next'] }
import presets from 'babel-preset-next'
This package is a CommonJS preset for Babel, not a JavaScript module. Use string reference in .babelrc or babel.config.js.
preset
const next = require('babel-preset-next')
import { preset } from 'babel-preset-next'
The package exports a single function as module.exports, not a named export. Use require for CommonJS.
options
// In .babelrc: { "presets": [["next", { "targets": { "ie": 9 } }]] }
Options are passed as an array in Babel configuration. Common mistake is to omit the array wrapping.

Shows installation and configuration of babel-preset-next via .babelrc and webpack.

// Install npm install --save-dev @babel/core @babel/preset-env babel-loader babel-preset-next // .babelrc { "presets": [ ["next", { "targets": { "ie": 9 }, "debug": false }] ] } // webpack.config.js (if using babel-loader) module.exports = { module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [['next', { targets: { ie: 9 } }]] } } } ] } };
Debug
Known issues
deprecatedDeprecated: async-generator-functions, class-properties, object-rest-spread, decorators are now part of @babel/preset-env or stage presets.
fix
Consider using @babel/preset-env with appropriate targets and plugin-proposal-* for individual proposals.
affects: <=1.4.0
gotchaRequires Babel 7.0 and babel-loader 8.0+. Older versions will break.
fix
Ensure @babel/core >=7.0.0 and babel-loader >=8.0.0 are installed.
affects: >=1.0.0
gotchaDefault target is IE 9; if you target modern browsers, UglifyJS may fail on ES6+ syntax.
fix
Use babel-minify or upgrade webpack to v4 with latest uglifyjs-webpack-plugin.
affects: >=1.0.0
breakingBreaking: v1.0.0 switched to Babel 7 plugins; not backward compatible with Babel 6.
fix
Migrate to Babel 7 if using this preset.
affects: >=1.0.0 <2.0.0
Errors
Common errors & fixes
Cannot find module '@babel/core'
@babel/core not installed as a dev or peer dependency.
fix
npm install --save-dev @babel/core
Error: Plugin/Preset files are not allowed to export objects, only functions.
Attempting to import the preset as an ES module or incorrect require.
fix
Use require('babel-preset-next') or string reference in .babelrc.
Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: Cannot read property 'bindings' of null
Incompatible Babel version (e.g., Babel 6 with this preset).
fix
Upgrade to @babel/core 7+ and babel-loader 8+.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency required for Babel compilation.
Agent activity
6 hits · last 30 days
node
6
Resources
babel-preset-next — npm install babel-preset-next · libregistry