babel-preset-yoshi
raw JSON → 4.78.0 verified Sat Apr 25 auth: no javascript
A Babel 7 preset (v4.78.0) for Yoshi, Wix's build toolchain. It includes transforms for modern JavaScript, React (with JSX), TypeScript, and other Babel plugins commonly needed in Wix projects. Release cadence follows yoshi's lifecycle. Key differentiators: opinionated defaults for Wix's monorepo and application conventions, integration with yoshi's module resolution, and minimal configuration overhead compared to manually assembling Babel presets. Supports JavaScript and TypeScript with automatic polyfilling for target environments.
Common errors
error Error: Cannot find module 'babel-preset-yoshi' ↓
cause Package not installed or missing from node_modules.
fix
Run npm install babel-preset-yoshi --save-dev
error Error: Multiple presets attempting to resolve React. Check your Babel config ↓
cause Conflicting React presets (e.g., @babel/preset-react alongside babel-preset-yoshi with react: true).
fix
Set react: false in babel-preset-yoshi options if using another React preset, or remove the other preset.
error Error: .babelrc: "Unknown option: targets" ↓
cause targets option passed at top level instead of inside preset config.
fix
Wrap preset options: { "presets": [["babel-preset-yoshi", { "targets": {...} }]] }
Warnings
breaking Dropped support for Node.js < 12 in v4.0.0 ↓
fix Upgrade Node.js to version 12 or higher.
deprecated The 'modules' option is deprecated, use 'useESModules' instead. ↓
fix Replace { modules: false } with { useESModules: true } in preset options.
gotcha When using with TypeScript, ensure 'typescript: true' is set, else .ts files will not be transformed. ↓
fix Set { typescript: true } in preset options if using TypeScript.
gotcha Auto polyfill via @babel/preset-env may conflict if you also install @babel/polyfill manually. ↓
fix Remove explicit @babel/polyfill import if preset handles polyfilling via useBuiltIns.
Install
npm install babel-preset-yoshi yarn add babel-preset-yoshi pnpm add babel-preset-yoshi Imports
- babel-preset-yoshi wrong
Error: Cannot find module 'babel-preset-yoshi' if not installedcorrectconst presets = ['babel-preset-yoshi']; // or .babelrc: { "presets": ["babel-preset-yoshi"] }
Quickstart
// Install: npm install --save-dev babel-preset-yoshi @babel/core
// .babelrc
{
"presets": [
["babel-preset-yoshi", {
"targets": {
"browsers": ["last 2 versions"]
},
"typescript": false,
"react": true
}]
]
}