A highly optimized transpiler for JSX, CJS, and ESM, built for the Sandpack ecosystem and based on Sucrase. Version 0.3.2 (pre-stable) ships TypeScript types, requires Node >=16, and focuses on performance, claiming >1M lines/sec on benchmarks. It is designed specifically for in-browser transpilation in sandboxed environments, distinguishing itself from general-purpose transpilers like Babel, esbuild, and swc by targeting Sandpack's use cases with minimal overhead. Currently in active development with no stable release.
npm install sandpack-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpile a simple ESM module using the default React preset. The result is ESNext with JSX compiled.
Replace `import { transform } from 'sandpack-transpiler'` with `import { transpile } from 'sandpack-transpiler'`.Always `await transpile(...)` or chain `.then()`.
Use `transforms: ['jsx', 'imports']` instead of `preset: 'react'`.
Upgrade Node.js to version 16 or later.
Use `new SandpackTranspiler()` and call `.transpile()` method, or import `{ transpile }` instead.Replace `{ preset: 'react' }` with `{ transforms: ['jsx', 'imports'] }`.Use `import { transpile } from 'sandpack-transpiler'` and call it as a function.Ensure package.json has `"type": "module"` or use `.mjs` extension.