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

jsxRuntimeImport not getting picked up? #801

Closed
shish opened this issue Nov 28, 2022 · 4 comments
Closed

jsxRuntimeImport not getting picked up? #801

shish opened this issue Nov 28, 2022 · 4 comments

Comments

@shish
Copy link
Contributor

shish commented Nov 28, 2022

When I have this in my package.json, the output is changed appropriately:

    "svgr": {
        "jsxRuntime": "classic-preact"
    }

But this seems to have no effect :(

    "svgr": {
        "jsxRuntimeImport": { "source": "preact", "specifiers": ["h"] },
    }

(I need to use the custom version because I'm using HyperApp as a framework, and so I need my h to be imported from the hyperapp-jsx-pragma package)

@shish
Copy link
Contributor Author

shish commented Nov 28, 2022

Looks like this might need even more work, because the hyperapp integration expects

import h from "hyperapp-jsx-pragma";

where the existing code only seems to support

import { h } from "blah";

D:

shish added a commit to shish/svgr that referenced this issue Nov 28, 2022
I need to have a config which isn't currently supported
shish added a commit to shish/svgr that referenced this issue Nov 28, 2022
…#801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
shish added a commit to shish/svgr that referenced this issue Nov 29, 2022
…#801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
shish added a commit to shish/svgr that referenced this issue Nov 29, 2022
I need to have a config which isn't currently supported
shish added a commit to shish/svgr that referenced this issue Nov 29, 2022
…#801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
shish added a commit to shish/svgr that referenced this issue Nov 29, 2022
…#801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
shish added a commit to shish/svgr that referenced this issue Nov 29, 2022
…#801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
@ysulyma
Copy link

ysulyma commented Dec 14, 2022

+1

1 similar comment
@fccoelho7
Copy link

+1

gregberge pushed a commit that referenced this issue Mar 14, 2023
* Allow specifying `jsxRuntimeImport` in config, see #801

I need to have a config which isn't currently supported

* Allow specifying a single specifier for custom imports, see #801

`hyperapp-jsx-pragma` uses the default export so we need to `import h from "hyperapp-jsx-pragma"`, not `import { h } from "hyperapp-jsx-pragma"`
@gregberge
Copy link
Owner

Fixed in 86bb86f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants