Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykingxyz committed Dec 13, 2024
1 parent df4ed65 commit e4322c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl From<RawStorageOptions> for StorageOptions {
"filesystem" => StorageOptions::FileSystem {
directory: value.directory.into(),
},
s => panic!("unsupport storage type {s}"),
s => panic!("unsupported storage type {s}"),
}
}
}
14 changes: 12 additions & 2 deletions packages/rspack/src/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ export const applyRspackOptionsDefaults = (
// but Rspack currently does not support this option
F(options, "cache", () => development);

applyExperimentsDefaults(options.experiments, { production });
applyExperimentsDefaults(options.experiments, {
production,
disableCache: options.cache === false
});

if (options.experiments.cache === false) {
options.cache = false;
}

applySnapshotDefaults(options.snapshot, { production });

Expand Down Expand Up @@ -194,10 +201,13 @@ const applyInfrastructureLoggingDefaults = (

const applyExperimentsDefaults = (
experiments: ExperimentsNormalized,
{ production }: { production: boolean }
{ production, disableCache }: { production: boolean; disableCache: boolean }
) => {
// IGNORE(experiments.cache): In webpack, cache is undefined by default
F(experiments, "cache", () => !production);
if (disableCache) {
experiments.cache = false;
}

D(experiments, "futureDefaults", false);
// IGNORE(experiments.lazyCompilation): In webpack, lazyCompilation is undefined by default
Expand Down

0 comments on commit e4322c9

Please sign in to comment.