Replies: 1 comment 1 reply
-
This seems to have been broken since nextjs v13.4.20-canary.32. From what i can see it because I would really love to see this resolved somehow, as it's a blocker for using eg. lit-element custom elements with nextjs ssr in the latest versions, but I just can't seem to find a way to monkey patch react anymore. I'd love to hear some ideas I can use to debug it further |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
I'd like to be able to modify/enhance the webpack externals function below in a safe/stable way without fear of breakage.
next.js/packages/next/src/build/webpack-config.ts
Lines 1378 to 1429 in 412dfc5
We are working on a Next.js plugin/config wrapper that require webpack loader to be applied even for certain code in node_modules. In our case we want to grab any imports of
react/jsx-runtime
orreact/jsx-dev-runtime
to replace with our own version. Specifying thejsxImportSource
is not enough as we'd like to also handle external components pre-compiled with the auto runtime jsx.Describe the solution you'd like
I'm not entirely sure what the best ergonomics of this would be. Perhaps naming and exporting the server handle external functions linked above so the
webpack.externals
array can be checked to see whether it exists and write a modified version for it.Describe alternatives you've considered
For now, I'm doing this within the webpack config function.
I'm just afraid grabbing
config.externals[0]
will break in a future version.Beta Was this translation helpful? Give feedback.
All reactions