[builtin:swc-loader]: do i always need to exclude node_modules? #14063
Replies: 1 comment
|
The docs are showing two different For syntax lowering / TypeScript transpilation, you exclude all of exclude: [/node_modules/]This makes sense because your dependencies should already be shipping compiled JS. You don't want SWC re-transpiling them — it's slow and can break things. For polyfill injection (the exclude: /node_modules[\\/]core-js/This only excludes So the answer is: it depends on what you're doing.
If you're doing both in a single rule, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi team, i am trying to setup builtin:swc-loader in my react project with syntax lowering. And in
builtin:swc-loaderdocs for ts transpilation here we haveexclude: [/node_modules/]field, but in polyfill injection jsx/tsx part here we have onlyexclude: /node_modules[\\/]core-js/, so from docs it is not clear, in second case are node modules being excluded? or only core-js is excluded and swc will attempt to process files innode_modulesas well?so should this exclude be enough for both cases?:
exclude: [/node_modules/]?All reactions