Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add builtins.react/... only works for transformByDefault tip #4249

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/rspack/src/builtin-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,31 @@ export function deprecated_resolveBuiltins(
noEmitAssets = true;
}

if (options.experiments.rspackFuture?.disableTransformByDefault) {
(
[
"react",
"pluginImport",
"decorator",
"presetEnv",
"emotion",
"relay"
] as const
).forEach(key => {
if (builtins[key]) {
deprecatedWarn(
`'builtins.${key} = ${JSON.stringify(
builtins[key]
)}' only works for 'experiments.rspackFuture.disableTransformByDefault = false', please migrate to ${termlink(
"builtin:swc-loader options",
"https://www.rspack.dev/guide/loader.html#builtinswc-loader"
)}`,
true
9aoy marked this conversation as resolved.
Show resolved Hide resolved
);
}
});
}

return {
// TODO: discuss with webpack, this should move to css generator options
css: options.experiments.css
Expand Down