Registry / http-networking / snack-babel-standalone

snack-babel-standalone

JSON →
library5.0.0jsnpmunverified

Standalone version of Babel bundled with presets and plugins for React Native, used in Expo Snack Runtime and Website. Version 5.0.0, released as part of the Snack monorepo. Optimized for runtime code parsing/transformation in browser environments, with two separate entrypoints (default for runtime, eslint for @babel/core replacement). Includes metro-react-native-babel-preset and @babel/preset-typescript. Unlike @babel/standalone, this is specifically tailored for React Native/Expo tooling and bundles only necessary dependencies to minimize bundle size.

npm install snack-babel-standalone
INSTALL
IMPORT
SIG · SNACK-BABEL-STANDA
S
snack-babel-standalone
http-networkingjavascriptv5.0.0
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.

babel
import * as babel from 'snack-babel-standalone'
import babel from 'snack-babel-standalone'
Package exports a namespace object, not a default export.
transform
import { transform } from 'snack-babel-standalone'
const { transform } = require('snack-babel-standalone')
ESM-only package, CommonJS require will not work.
BabelFileResult
import type { BabelFileResult } from 'snack-babel-standalone'
TypeScript type available for transform result.

Demonstrates importing the namespace and transforming TypeScript code with preset and plugin options.

import * as babel from 'snack-babel-standalone'; const code = `const x: number = 1;`; const result = babel.transform(code, { presets: ['module:metro-react-native-babel-preset'], plugins: [ ['@babel/plugin-proposal-decorators', { legacy: true }], ], filename: 'test.js', sourceMaps: true, compact: false, }); console.log(result.code);
Debug
Known issues
gotchaUsing CommonJS require() will fail because package is ESM-only.
fix
Use ES module import syntax, e.g., import * as babel from 'snack-babel-standalone'.
affects: >=5.0.0
gotchaDefault import does not exist; importing babel as default will yield undefined.
fix
Use namespace import: import * as babel from 'snack-babel-standalone'.
affects: >=5.0.0
breakingThe eslint entrypoint moved from snack-babel-standalone/eslint to snack-babel-standalone/eslint in v5.0.0.
fix
Use snack-babel-standalone/eslint for ESLint parser replacement.
affects: <5.0.0
Errors
Common errors & fixes
Module '"snack-babel-standalone"' has no default export.
Attempting to import default export, which does not exist.
fix
Use import * as babel from 'snack-babel-standalone' instead.
Error: Cannot find module 'snack-babel-standalone'
Package not installed or not in node_modules.
fix
Run 'yarn add snack-babel-standalone' or 'npm install snack-babel-standalone'.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
@babel/corerequiredBabel core is bundled internally, not a peer dependency
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
snack-babel-standalone — npm install snack-babel-standalone · libregistry