{"id":19299,"library":"babel-preset-granite","title":"babel-preset-granite","description":"Babel preset for Granite, a React Native toolkit. Version 1.0.22. This preset configures Babel for Granite projects, including necessary plugins and transforms. It is part of the Granite ecosystem maintained by Viva Republica (Toss). The preset is designed to work seamlessly with Granite's build system and custom metro configuration. It should be used alongside other Granite packages like @granite/everywhere. No known major alternatives as it is specific to Granite.","status":"active","version":"1.0.22","language":"javascript","source_language":"en","source_url":"https://github.com/toss/granite","tags":["javascript","typescript"],"install":[{"cmd":"npm install babel-preset-granite","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-granite","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-granite","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Babel presets are typically required via module.exports in .babelrc.js or babel.config.js. Although the package may ship TypeScript types, using ESM import syntax may not work depending on Node version and module resolution.","wrong":"import preset from 'babel-preset-granite'","symbol":"default","correct":"module.exports = require('babel-preset-granite')"},{"note":"Babel will resolve the preset name 'granite' to the package 'babel-preset-granite' automatically. Using the full package name is unnecessary but still works.","wrong":"module.exports = { presets: ['babel-preset-granite'] }","symbol":"granitePreset","correct":"module.exports = { presets: ['granite'] }"},{"note":"Use the short name 'granite' in the presets array. Options are passed as the second element of the tuple.","wrong":"module.exports = { presets: [['babel-preset-granite', { option: true }]] }","symbol":"granitePreset with options","correct":"module.exports = { presets: [['granite', { option: true }]] }"}],"quickstart":{"code":"// In babel.config.js\nmodule.exports = {\n  presets: ['granite'],\n}\n","lang":"javascript","description":"Shows how to configure Babel to use the Granite preset via the shorthand name 'granite'."},"warnings":[{"fix":"Use 'granite' in presets array: presets: ['granite'].","message":"Preset name resolution: Using full package name 'babel-preset-granite' works but is not recommended. Babel expects the short name 'granite'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update both babel-preset-granite and @granite/* packages to compatible versions.","message":"As of Granite 0.1.x, some Babel plugins have been moved to runtime (e.g., asyncIterator polyfill). Ensure preset version matches Granite version.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-preset-granite' or 'yarn add babel-preset-granite'.","cause":"The package is not installed or not in node_modules.","error":"Module not found: Can't resolve 'babel-preset-granite'"},{"fix":"Install the package and ensure babel.config.js uses the correct path or name.","cause":"Using the short name 'granite' but the package is not installed.","error":"Error: Preset 'granite' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}