RFC-019: more target environments support #648
jerrykingxyz
started this conversation in
RFC
Replies: 1 comment 1 reply
-
I have a few concerns:
|
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
-
Summary
let rspack support to compile for multiple environments, such as web, webworker, es5, browserslist and more
Motivation
even we support most features out of the box in rspack, but we still need to some swc compile configuration for custom result.
for example
etc...
Guide-level explanation
target config
like webpack target, we need to support more type of target
env.targets
in swc configWhen multiple targets are passed, then common subset of features will be used
Set target to false if none of the predefined targets from the list above meet your needs, no plugins will be applied.
swc config
even though the
target
above can control ouput result, we still need to some swc compile configuration for custom result. we can wrap and expose some swc param inbuiltins
Reference-level explanation
target config
swc config
because of swc does not support reading browserslist config from
.browserslistrc
&package.json
(more info), we will use browserslist to load config in node and pass intobuiltins.browserslist
The first stage
in this stage, we will
target
configThe scond stage
in this stage, we will
builtins.swc
configDrawbacks
Nope
Prior art
Nope
Unresolved questions
Nope
Future possibilities
Nope
Beta Was this translation helpful? Give feedback.
All reactions