Registry / web-framework / babel-preset-granite

babel-preset-granite

JSON →
library1.0.22jsnpmunverified

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.

npm install babel-preset-granite
INSTALL
IMPORT
SIG · BABEL-PRESET-GRANI
B
babel-preset-granite
web-frameworkjavascriptv1.0.22
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
module.exports = require('babel-preset-granite')
import preset from 'babel-preset-granite'
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.
granitePreset
module.exports = { presets: ['granite'] }
module.exports = { presets: ['babel-preset-granite'] }
Babel will resolve the preset name 'granite' to the package 'babel-preset-granite' automatically. Using the full package name is unnecessary but still works.
granitePreset with options
module.exports = { presets: [['granite', { option: true }]] }
module.exports = { presets: [['babel-preset-granite', { option: true }]] }
Use the short name 'granite' in the presets array. Options are passed as the second element of the tuple.

Shows how to configure Babel to use the Granite preset via the shorthand name 'granite'.

// In babel.config.js module.exports = { presets: ['granite'], }
Debug
Known issues
gotchaPreset name resolution: Using full package name 'babel-preset-granite' works but is not recommended. Babel expects the short name 'granite'.
fix
Use 'granite' in presets array: presets: ['granite'].
affects: >=1.0.0
deprecatedAs of Granite 0.1.x, some Babel plugins have been moved to runtime (e.g., asyncIterator polyfill). Ensure preset version matches Granite version.
fix
Update both babel-preset-granite and @granite/* packages to compatible versions.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'babel-preset-granite'
The package is not installed or not in node_modules.
fix
Run 'npm install babel-preset-granite' or 'yarn add babel-preset-granite'.
Error: Preset 'granite' not found
Using the short name 'granite' but the package is not installed.
fix
Install the package and ensure babel.config.js uses the correct path or name.
Upgrade
Version history
1.0.22latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-granite — npm install babel-preset-granite · libregistry