esbuild-py

command module
v0.0.0-...-b16ad26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 2 Imported by: 0

README

esbuild-py

PyPI Open In Colab - minimal Open In Colab - dynamic-importmap

Python bindings to the esbuild Transform API.

For the oxc equivalent, see oxc-py.

Installation

pip install esbuild_py

Usage

from esbuild_py import transform

jsx = """
import * as React from 'react'
import * as ReactDOM from 'react-dom'

ReactDOM.render(
    <h1>Hello, world!</h1>,
    document.getElementById('root')
);
"""

print(transform(jsx))

API

transform

Parameters:

  • jsx (str) - The JSX string to be transformed.

Returns: str - The transformed JS as a string.

Development

Setup

Create conda environment

conda create -n esbuild-py python=3.11
Build
conda activate esbuild-py
go get github.com/keller-mark/esbuild-py
# go build -buildmode=c-shared -o _esbuild.so
Develop

Build python package and install in editable mode

python setup.py bdist_wheel
python setup.py sdist
pip install -e .
Publish

Increment the version in pyproject.toml. The cibuildwheel GH action will build wheels for a matrix of Python versions, OS, and architectures. Then, GH actions will publish to PyPI.

Resources

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL