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 a79aa58
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 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}"),
}
}
}
2 changes: 1 addition & 1 deletion crates/rspack_storage/tests/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[cfg(test)]
#[cfg_attr(miri, ignore)]
mod test_storage_dev {
use std::{collections::HashMap, path::PathBuf, sync::Arc};

Expand Down Expand Up @@ -140,6 +139,7 @@ mod test_storage_dev {
}

#[tokio::test]
#[cfg_attr(miri, ignore)]
async fn test_dev() {
let cases = [
(
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_storage/tests/dev.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[cfg(test)]
#[cfg_attr(miri, ignore)]
mod test_storage_build {
use std::{collections::HashMap, path::PathBuf, sync::Arc};

Expand Down Expand Up @@ -107,6 +106,7 @@ mod test_storage_build {
}

#[tokio::test]
#[cfg_attr(miri, ignore)]
async fn test_build() {
let cases = [
(
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_storage/tests/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[cfg(test)]
#[cfg_attr(miri, ignore)]
mod test_storage_error {
use std::{path::PathBuf, sync::Arc};

Expand Down Expand Up @@ -155,6 +154,7 @@ mod test_storage_error {
}

#[tokio::test]
#[cfg_attr(miri, ignore)]
async fn test_error() {
let cases = [
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Object {
},
experiments: Object {
asyncWebAssembly: false,
cache: true,
cache: false,
css: undefined,
futureDefaults: false,
incremental: Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = {
- "devtool": false,
+ "devtool": "eval",
@@ ... @@
- "cache": false,
+ "cache": true,
@@ ... @@
- "mode": "none",
+ "mode": "development",
@@ ... @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = {
- "devtool": false,
+ "devtool": "eval",
@@ ... @@
- "cache": false,
+ "cache": true,
@@ ... @@
- "mode": "none",
+ "mode": "development",
@@ ... @@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = {
- Expected
+ Received
@@ ... @@
- "cache": true,
+ "cache": false,
@@ ... @@
- "incremental": Object {
- "buildChunkGraph": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = {
- Expected
+ Received
@@ ... @@
- "cache": true,
+ "cache": false,
@@ ... @@
- "incremental": Object {
- "buildChunkGraph": false,
Expand Down
13 changes: 10 additions & 3 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,
development
});

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

applySnapshotDefaults(options.snapshot, { production });

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

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

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

0 comments on commit a79aa58

Please sign in to comment.