{"id":19305,"library":"babel-preset-kyt-core","title":"babel-preset-kyt-core","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/nytimes/kyt","tags":["javascript","babel","babel-preset","kyt"],"install":[{"cmd":"npm install babel-preset-kyt-core","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-kyt-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-kyt-core","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for Babel transformation","package":"@babel/core","optional":false},{"reason":"core transpilation preset","package":"@babel/preset-env","optional":false},{"reason":"React JSX support","package":"@babel/preset-react","optional":false},{"reason":"TypeScript support","package":"@babel/preset-typescript","optional":true}],"imports":[{"note":"CJS-only package; use require() in Babel config.","wrong":"import preset from 'babel-preset-kyt-core'","symbol":"default","correct":"module.exports = require('babel-preset-kyt-core')"},{"note":"No options needed; if you pass options, they override defaults.","wrong":"{\n  \"presets\": [\"babel-preset-kyt-core\", {}]\n}","symbol":"babel preset","correct":"{\n  \"presets\": [\"babel-preset-kyt-core\"]\n}"}],"quickstart":{"code":"// .babelrc\n{\n  \"presets\": [\n    \"babel-preset-kyt-core\"\n  ]\n}\n\n// or in package.json:\n\"babel\": {\n  \"presets\": [\"babel-preset-kyt-core\"]\n}","lang":"javascript","description":"Shows how to add the preset to a Babel configuration, with no additional options required."},"warnings":[{"fix":"Use require() in .babelrc.js or babel.config.js: module.exports = { presets: [require('babel-preset-kyt-core')] };","message":"Preset is CJS-only; cannot be imported as ESM in Babel config with 'import' syntax.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"The preset uses core-js automatically; ensure core-js is installed.","message":"Polyfill via @babel/polyfill is deprecated in favor of core-js and regenerator-runtime.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"If using '@babel/runtime' with helpers, ensure '@babel/runtime' is installed as a dependency.","message":"Preset includes @babel/plugin-transform-runtime which can cause issues with instance methods if not configured properly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Node.js >= 12.","message":"Version 2.0.0 removed support for Node.js versions < 12.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Install core-js: npm install core-js","message":"The preset sets 'useBuiltIns: usage' but does not automatically install core-js. Missing core-js causes runtime errors.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"No action needed in v2, but consider migrating to latest @babel/preset-env.","message":"The preset implicitly enables @babel/plugin-proposal-class-properties (legacy) – stage 4 proposals are now in @babel/preset-env.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Install @babel/preset-typescript as a devDependency.","message":"If using TypeScript, the preset expects @babel/preset-typescript to be installed; not included transitively.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the preset: npm install babel-preset-kyt-core --save-dev","cause":"The package is not installed or not in node_modules.","error":"Error: Cannot find module 'babel-preset-kyt-core'"},{"fix":"Install regenerator-runtime: npm install regenerator-runtime and add import 'regenerator-runtime/runtime' at entry.","cause":"Missing regenerator-runtime when using async/await or generators.","error":"ReferenceError: regeneratorRuntime is not defined"},{"fix":"Use require() in Babel config: module.exports = { presets: [require('babel-preset-kyt-core')] };","cause":"Babel config tries to import the preset as ESM but it is CJS.","error":"Error: Plugin/Preset files are not allowed to export objects, only functions."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}