Replies: 4 comments 21 replies
-
@alexander-akait @ScriptedAlchemy @octogonz we need your valuable advice here, thanks |
Beta Was this translation helpful? Give feedback.
-
Do we really need to detect this automatically? Are we allowed to throw a warning if we are double transpiling? Auto detecting user intention doesn't sound right to me. |
Beta Was this translation helpful? Give feedback.
-
I'm +1 for the approach here: align with webpack, make a preset, and ship preset along side.
I should sync with @alexander-akait on this design but we could have some core presets living in webpack core: import {presets} from 'webpack';
module.exports = {
presets: [presets.ts(), ...]
} I think in comparison to what we have done in the past (which is just let users figure out how to use these separately maintained packages), that we own the recommended approach for many of these core experiences (react, ts, vue, css?, assets) and provide them to users automatically. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
this seems more ideal and vite use this way |
Beta Was this translation helpful? Give feedback.
-
Currently, in rspack, the default behavior is to enable SWC transpilation for all modules. which brings some benefits to rspack
But this also leads to the following issues:
We have addressed these issues by implementing the
builtin:swc-loader
. However, there are still some remaining problems:There are several possible solutions to this problem, we should make sure no breaking changes are introduced in the patch version:
In the long term, we need to decide whether to keep the features like type:
typescript
or type:javascript/{auto,cjs,esm} + swc
. Currently, both options have their pros and cons:javascript/swc-{auto/cjs/esm
:type:javascript/swc-auto
is more user-friendly than configuring a loader. but this is not consistent with webpack and it still has the problem of not supporting custom options.javascript/swc-{auto/cjs/esm
: user has to configure loaders for typescript and javascript module but this is consistent with webpack.we discussed internally and we all agree DX friendly and webpack consistent are both very important for rspack. so we come along with another way
so we think of a new way to both keep DX friendly and consistent with webpack.
since webpack begin to introduce preset webpack/webpack#17171, preset may solve our problem
ts
tsx
orjavascript/swc-auto
react
typescript
and so onbut there're some drawbacks about this method
Beta Was this translation helpful? Give feedback.
All reactions