Skip to content

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Aug 10, 2025

Description

After #687, this should work in principle. If not, we should improve cjs module runner transform.

TODO

@hi-ogawa hi-ogawa changed the title refactor(rsc): remove server optimizeDeps.include refactor(rsc): remove server optimizeDeps.include in favor of cjs module runner transform Aug 11, 2025
@hi-ogawa
Copy link
Contributor Author

We should try ecosystem ci (Waku and react-router). If it's fine, we should go forward.

@hi-ogawa
Copy link
Contributor Author

One concern is we might want this with enforce: "pre" so that other plugin won't see require.

@hi-ogawa
Copy link
Contributor Author

Cloudflare plugin tries to optimize everything by default and it seems to cause an issue. To prevent this, users now need optimizeDeps.exclude: ["react", "react-dom"], which feels like somewhat killing the purpose of this PR.

},
},
rsc: {
optimizeDeps: {
exclude: ['react-router'],
exclude: ['react-router', 'react', 'react-dom'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunate, but necessary anyways since react 3rd party libraries with potential "use client" cannot be optimized.

@hi-ogawa hi-ogawa marked this pull request as ready for review August 28, 2025 02:35
@hi-ogawa hi-ogawa marked this pull request as draft August 29, 2025 01:51
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 this pull request may close these issues.

Dependency resolution fails in pnpm monorepo when nodeLinker is not hoisted
1 participant