2025-06-11 22:23:49 +08:00

1.3 KiB

Sucrase

Sucrase is a super-fast alternative to Babel for when you can target modern JS runtimes.

Language Info

Name

sucrase

Extension

.sucrase

Editor

script

Compiler

The official Sucrase compiler.

Version

sucrase: v3.32.0

Custom Settings

Custom settings added to the property sucrase are passed as a JSON object to the transform function during compile. Please check the documentation for full reference.

By default, the following transforms are enabled: ['jsx', 'typescript']

Please note that custom settings should be valid JSON (i.e. functions are not allowed).

Example:

{
  "sucrase": { "transforms": ["typescript", "imports"] }
}

Example Usage

import LiveCodes from '../../src/components/LiveCodes.tsx';

export const params = { sucrase: 'export const Greet = (name: string) => <>Hello {name}!</>;', compiled: 'open', };