An opinionated Babel preset optimized for kyt, the NYTimes' universal JavaScript toolchain. Current version 2.0.1, released November 2023. It provides a curated set of Babel plugins and presets for modern JavaScript and React, including @babel/preset-env, @babel/preset-react, and @babel/preset-typescript, with automatic polyfill injection via core-js. Unlike generic presets, it is tuned for kyt's isomorphic architecture, supporting both client and server builds. It follows a semver release cadence alongside kyt packages, with maintenance as active.
npm install babel-preset-kyt-coreVerified import paths — ran on the pinned version, not inferred.
Shows how to add the preset to a Babel configuration, with no additional options required.
Use require() in .babelrc.js or babel.config.js: module.exports = { presets: [require('babel-preset-kyt-core')] };The preset uses core-js automatically; ensure core-js is installed.
If using '@babel/runtime' with helpers, ensure '@babel/runtime' is installed as a dependency.
Use Node.js >= 12.
Install core-js: npm install core-js
No action needed in v2, but consider migrating to latest @babel/preset-env.
Install @babel/preset-typescript as a devDependency.
Install the preset: npm install babel-preset-kyt-core --save-dev
Install regenerator-runtime: npm install regenerator-runtime and add import 'regenerator-runtime/runtime' at entry.
Use require() in Babel config: module.exports = { presets: [require('babel-preset-kyt-core')] };