Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let me change jsx compilerOption #384

Open
pschiffmann opened this issue Mar 14, 2024 · 0 comments
Open

Let me change jsx compilerOption #384

pschiffmann opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@pschiffmann
Copy link

My deno code contains jsx tags like: <div>hello world</div. I have configured my project to use React from npm, and use the automatic runtime, like so:

{
  "imports": {
    "react": "npm:[email protected]",
    "react/jsx-runtime": "npm:[email protected]/jsx-runtime"
  },
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "react"
  }
}

This setup works well locally as well as on Deno Deploy. However, when I try to compile this code with dnt, I get a bunch of these errors: error TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

The problem here is that dnt uses a hard-coded jsx compiler option value, and doesn't let me overwrite it:

dnt/mod.ts

Lines 284 to 286 in 2d1d120

jsx: ts.JsxEmit.React,
jsxFactory: "React.createElement",
jsxFragmentFactory: "React.Fragment",

@dsherret dsherret added bug Something isn't working good first issue Good for newcomers labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants