Skip to content

Transpile node_modules like create-react-app #915

Closed Answered by chenjiahan
Godsenal asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your feedback!

Whether to compile node_modules is a frequently discussed issue. It can provide better compatibility but sacrifices build performance since most dependencies do not require secondary compilation.

Most modern frameoworks do not transpile node_modules by default, Next.js provides transpilePackages to manually control this.

With Rsbuild, we provide include to transpile dependencies and Check Syntax Plugin to automatically detect syntax issues. This is what we currently recommend.

For CRA projects, how about adding some notes to the CRA migrate guide? If the project needs to be consistent with CRA's behavior, it can manually add include node_modules.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Godsenal
Comment options

You must be logged in to vote
1 reply
@chenjiahan
Comment options

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