Registry / web-framework / babel-preset-kyt

babel-preset-kyt

JSON →
library1.1.21jsnpmunverified

An opinionated Babel preset for kyt, the NY Times frontend toolkit. Current stable version is 1.1.21 (last released May 2025). It provides a pre-configured Babel setup for React and TypeScript projects, supporting both ESM and CJS modules. Key differentiators: tightly integrated with kyt for zero-config transpilation, includes presets for environment-specific builds (browser, node), and handles module transforms. Alternatives like @babel/preset-env and @babel/preset-react require manual configuration.

npm install babel-preset-kyt
INSTALL
IMPORT
SIG · BABEL-PRESET-KYT
B
babel-preset-kyt
web-frameworkjavascriptv1.1.21
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default export
✓ module.exports = require('babel-preset-kyt')
✗ import preset from 'babel-preset-kyt'
Preset is CommonJS; ESM import is not supported directly. Use require() or use .babelrc presets array.
preset in .babelrc
✓ {"presets": ["babel-preset-kyt"]}
✗ {"presets": ["kyt"]}
Use full package name to avoid resolution ambiguity.
preset with options
✓ {"presets": [["babel-preset-kyt", { "modules": false }]]}
✗ {"presets": ["babel-preset-kyt", { "modules": false }]}
Options must be in an array: [preset, options].

Configures babel-preset-kyt in .babelrc and babel.config.js with environment-specific targets.

// .babelrc { "presets": ["babel-preset-kyt"] } // Or in babel.config.js module.exports = { presets: ["babel-preset-kyt"], // optionally override env targets env: { browser: { presets: [["babel-preset-kyt", { targets: "> 0.25%, not dead" }]] }, node: { presets: [["babel-preset-kyt", { targets: { node: "current" } }]] } } }
Debug
Known issues
gotchaPreset is CommonJS only; ESM import will fail with 'require is not defined' error.
fix
Use require() or configure via .babelrc/babel.config.js.
affects: >=1.0.0
gotchaOptions must be passed as array elements: [preset, options]. Direct object after preset string is ignored.
fix
Use nested arrays: "presets": [["babel-preset-kyt", { ... }]]
affects: >=1.0.0
gotchaIf using TypeScript, ensure @babel/preset-typescript is installed separately.
fix
npm install @babel/preset-typescript --save-dev and add to presets array.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-kyt'
Missing package installation
fix
npm install babel-preset-kyt --save-dev
Error: Plugin/Preset files are not allowed to export objects, only functions.
Using ESM import to load preset
fix
Use require() or configure via .babelrc/babel.config.js (CommonJS).
SyntaxError: Unexpected token import
Preset not applied; possibly missing configuration
fix
Verify .babelrc or babel.config.js includes 'babel-preset-kyt' in presets array.
Upgrade
Version history
1.1.21latest on npm
Audit
Dependencies
@babel/corerequiredpeer dependency: required for Babel compilation
@babel/preset-envrequiredcore preset for modern JavaScript
@babel/preset-reactrequiredpreset for React JSX/transform
@babel/preset-typescriptoptionalpreset for TypeScript support
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
babel-preset-kyt — npm install babel-preset-kyt · libregistry