Skip to content

Commit

Permalink
chore: add deprecatedWarn for builtins.react/pluginImport/... when di…
Browse files Browse the repository at this point in the history
…sableTransformByDefault
  • Loading branch information
9aoy committed Sep 26, 2023
1 parent 591f55d commit 45329fc
Showing 1 changed file with 25 additions and 0 deletions.
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]
)}' has been deprecated, please migrate to ${termlink(
"builtin:swc-loader options",
"https://www.rspack.dev/guide/loader.html#builtinswc-loader"
)}`,
true
);
}
});
}

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

0 comments on commit 45329fc

Please sign in to comment.