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

perf: enable SWC disableAllLints by default to reduce overhead #8275

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Changes from 2 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
17 changes: 13 additions & 4 deletions packages/rspack/src/config/adapterRuleUse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,19 @@ type GetLoaderOptions = (
) => RuleSetLoaderWithOptions["options"];

const getSwcLoaderOptions: GetLoaderOptions = (o, _) => {
if (o && typeof o === "object" && o.rspackExperiments) {
const expr = o.rspackExperiments;
if (expr.import || expr.pluginImport) {
expr.import = resolvePluginImport(expr.import || expr.pluginImport);
if (o && typeof o === "object") {
// enable `disableAllLints` by default to reduce performance overhead
o.jsc ??= {};
o.jsc.experimental ??= {};
o.jsc.experimental.disableAllLints ??= true;

// resolve `rspackExperiments.import` options
const { rspackExperiments } = o;
if (rspackExperiments) {
const expr = rspackExperiments;
if (expr.import || expr.pluginImport) {
expr.import = resolvePluginImport(expr.import || expr.pluginImport);
}
}
}
return o;
Expand Down