Skip to content

Transpilation Of TypeScript

Overview

Under the hood Storona uses tsup to transpile TypeScript/JSX files. This allows developers to write code in TypeScript and use the latest ECMAScript features without worrying about bundler configuration or how to transpile the code.

IMPORTANT

Storona will not transpile the code if given runtime is Bun. This guide is only applicable for the Node.js runtime.

Configuration

Storona does not provide any configuration for the transpilation process. However, some package.json or tsconfig.json fields can be used to configure the transpilation process.

CJS/ESM Output

To configure the output format of the transpiled code, you can use the type field in the package.json file. The type field can be set to module or commonjs to specify the output.

Storona, similar to Node.js, defaults to commonjs if the type field is not set.

json
{
  "type": "module"
}

JSX Support

To configure JSX transpilation process, you can use the jsx field in the tsconfig.json file to specify the output.

Storona defaults to react if the jsx field is not set.

json
{
  "compilerOptions": {
    "jsx": "react"
  }
}

Released under the MIT License.