Skip to content

Commit

Permalink
docs: delete benchmark page (#7566)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Aug 14, 2024
1 parent 98c0c13 commit 7e99bf2
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions packages/rspack/src/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import type {
Optimization,
Performance,
ResolveOptions,
RspackFutureOptions,
RuleSetRules,
SnapshotOptions
} from "./zod";
Expand Down Expand Up @@ -110,6 +111,11 @@ export const applyRspackOptionsDefaults = (
entry: options.entry,
futureDefaults: options.experiments.futureDefaults!
});
// bundlerInfo is affected by outputDefaults so must be executed after outputDefaults
applybundlerInfoDefaults(
options.experiments.rspackFuture,
options.output.library
);

applyExternalsPresetsDefaults(options.externalsPresets, {
targetProperties
Expand Down Expand Up @@ -197,16 +203,24 @@ const applyExperimentsDefaults = (experiments: ExperimentsNormalized) => {

// IGNORE(experiments.rspackFuture): Rspack specific configuration
D(experiments, "rspackFuture", {});
if (typeof experiments.rspackFuture === "object") {
D(experiments.rspackFuture, "bundlerInfo", {});
if (typeof experiments.rspackFuture.bundlerInfo === "object") {
// rspackFuture.bundlerInfo default value is applied after applyDefaults
};

const applybundlerInfoDefaults = (
rspackFuture?: RspackFutureOptions,
library?: Library
) => {
if (typeof rspackFuture === "object") {
// don't inject for library mode
D(rspackFuture, "bundlerInfo", library ? undefined : {});
if (typeof rspackFuture.bundlerInfo === "object") {
D(
experiments.rspackFuture.bundlerInfo,
rspackFuture.bundlerInfo,
"version",
require("../../package.json").version
);
D(experiments.rspackFuture.bundlerInfo, "bundler", "rspack");
D(experiments.rspackFuture.bundlerInfo, "force", true);
D(rspackFuture.bundlerInfo, "bundler", "rspack");
D(rspackFuture.bundlerInfo, "force", true);
}
}
};
Expand Down

0 comments on commit 7e99bf2

Please sign in to comment.