Babel preset used by Razzle, a zero-configuration universal JavaScript framework. Current stable version is 4.2.18. It provides a pre-configured set of plugins for React, including JSX, object rest spread, and dynamic import. Designed for server-side rendering (SSR) with automatic environment detection based on BABEL_ENV or NODE_ENV. It ships as a CommonJS module and is not meant to be used outside of Razzle unless you manually configure Babel. Released as part of the Razzle monorepo with updates tied to Razzle releases.
npm install babel-preset-razzleVerified import paths — ran on the pinned version, not inferred.
Basic setup of babel-preset-razzle in .babelrc with custom targets and options.
Set BABEL_ENV appropriately for your build scripts: BABEL_ENV=server for server bundle, BABEL_ENV=client for client bundle.
Add options to .babelrc: { presets: [['razzle', { corejs: 3 }]] } and install core-js@3.Update any custom Babel config that extends or overrides razzle preset to use the function form and inspect the returned config objects.
Install and configure @babel/preset-typescript or use the official razzle-plugin-typescript plugin.
Upgrade Node.js to >=10.13.0 or configure @babel/preset-env targets explicitly.
Run npm install --save-dev babel-preset-razzle.
Upgrade to babel-preset-razzle@4 or later, or remove the `corejs` option and use the default core-js@2 behavior.
Ensure you are using babel-preset-razzle@4 or later, or add @babel/plugin-proposal-class-properties manually.