这是indexloc提供的服务,不要输入任何密码
Skip to content

Specify JSX Runtime? #390

@ericclemmons

Description

@ericclemmons

Thanks for creating this! I had issues with vite and generating .d.ts files, but tsup has been working great!

The only thing I noticed with my React library are these errors:

ReferenceError: React is not defined

Adding import * as React from 'react'; at the top of each file fixes it.

But based on developit/microbundle#763 (comment), I was wondering if it'd be possible to do something similar like:

tsup --jsx 'React.createElement' --jsxImportSource react --globals react/jsx-runtime=jsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions