Skip to content

[v2] Rollup plugin and jsx-runtime import rename in ESM env #1794

Answered by jugglingcats
jugglingcats asked this question in Q&A
Discussion options

You must be logged in to vote

Of course I immediately found the answer after posting my question. For others arriving here, we can add resolve/alias to the Vite config which is passed to Rollup:

/**
 * @type {import('vite').UserConfig}
 */
export default {
    resolve: {
        alias: {
            "react/jsx-runtime": "react/jsx-runtime.js"
        }
    },
    plugins: [
...

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@wooorm
Comment options

@jugglingcats
Comment options

@silvenon
Comment options

@jugglingcats
Comment options

@silvenon
Comment options

Answer selected by jugglingcats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants