diff --git a/crates/rspack_core/src/exports_info.rs b/crates/rspack_core/src/exports_info.rs index 67a43b34c28..12b72324bef 100644 --- a/crates/rspack_core/src/exports_info.rs +++ b/crates/rspack_core/src/exports_info.rs @@ -1,6 +1,7 @@ use std::borrow::Cow; use std::collections::hash_map::Entry; use std::collections::BTreeMap; +use std::collections::VecDeque; use std::rc::Rc; use std::sync::atomic::AtomicU32; use std::sync::atomic::Ordering::Relaxed; @@ -1063,7 +1064,7 @@ impl ExportInfo { if info.terminal_binding { return Some(TerminalBinding::ExportInfo(*self)); } - let target = self.get_target(mg, None)?; + let target = self.get_target(mg)?; let exports_info = mg.get_exports_info(&target.module); let Some(export) = target.export else { return Some(TerminalBinding::ExportsInfo(exports_info)); @@ -1137,15 +1138,12 @@ impl ExportInfo { false } - pub fn get_target( - &self, - mg: &ModuleGraph, - resolve_filter: Option, - ) -> Option { - let filter = resolve_filter.unwrap_or(Rc::new(|_, _| true)); - + // This is a limited version of [ExportInfo::get_target_mut]: + // 1. mg is &ModuleGraph -> Won't modify module graph, more friendly for cache and parallel + // 2. don't support resolve_filter -> Just get the target module of the terminal binding + pub fn get_target(&self, mg: &ModuleGraph) -> Option { let mut already_visited = UkeySet::default(); - match self._get_target(mg, filter, &mut already_visited) { + match self._get_target(mg, &mut already_visited) { Some(ResolvedExportInfoTargetWithCircular::Circular) => None, Some(ResolvedExportInfoTargetWithCircular::Target(target)) => Some(target), None => None, @@ -1155,7 +1153,6 @@ impl ExportInfo { fn _get_target( &self, mg: &ModuleGraph, - resolve_filter: ResolveFilterFnTy, already_visited: &mut UkeySet, ) -> Option { let self_export_info = mg.get_export_info_by_id(self); @@ -1173,7 +1170,81 @@ impl ExportInfo { export: item.export.clone(), }); - let target = resolve_target(values.next(), already_visited, resolve_filter.clone(), mg); + let target = resolve_target(values.next(), already_visited, mg); + + match target { + Some(ResolvedExportInfoTargetWithCircular::Circular) => { + Some(ResolvedExportInfoTargetWithCircular::Circular) + } + None => None, + Some(ResolvedExportInfoTargetWithCircular::Target(target)) => { + for val in values { + let resolved_target = resolve_target(Some(val), already_visited, mg); + match resolved_target { + Some(ResolvedExportInfoTargetWithCircular::Circular) => { + return Some(ResolvedExportInfoTargetWithCircular::Circular); + } + Some(ResolvedExportInfoTargetWithCircular::Target(tt)) => { + if target.module != tt.module { + return None; + } + if target.export != tt.export { + return None; + } + } + None => return None, + } + } + Some(ResolvedExportInfoTargetWithCircular::Target(target)) + } + } + } + + // This is the complete port of the webpack `getTarget`, with a mutable ModuleGraph + // For now only side_effects_flag_plugin need to modify module graph when getting + // the target module, to better support dynamic-reexports (webpack-test/cases/side-effects/dynamic-reexports) + pub fn get_target_mut( + &self, + mg: &mut ModuleGraph, + resolve_filter: ResolveFilterFnTy, + ) -> Option { + let mut already_visited = UkeySet::default(); + match self._get_target_mut(mg, resolve_filter, &mut already_visited) { + Some(ResolvedExportInfoTargetWithCircular::Circular) => None, + Some(ResolvedExportInfoTargetWithCircular::Target(target)) => Some(target), + None => None, + } + } + + fn _get_target_mut( + &self, + mg: &mut ModuleGraph, + resolve_filter: ResolveFilterFnTy, + already_visited: &mut UkeySet, + ) -> Option { + let self_export_info = mg.get_export_info_by_id(self); + if !self_export_info.target_is_set || self_export_info.target.is_empty() { + return None; + } + if already_visited.contains(self) { + return Some(ResolvedExportInfoTargetWithCircular::Circular); + } + already_visited.insert(*self); + + let max_target = self.get_max_target(mg); + let mut values = max_target + .values() + .map(|item| UnResolvedExportInfoTarget { + dependency: item.dependency, + export: item.export.clone(), + }) + .collect::>(); + let target = resolve_target_mut( + values.pop_front(), + already_visited, + resolve_filter.clone(), + mg, + ); match target { Some(ResolvedExportInfoTargetWithCircular::Circular) => { @@ -1183,7 +1254,7 @@ impl ExportInfo { Some(ResolvedExportInfoTargetWithCircular::Target(target)) => { for val in values { let resolved_target = - resolve_target(Some(val), already_visited, resolve_filter.clone(), mg); + resolve_target_mut(Some(val), already_visited, resolve_filter.clone(), mg); match resolved_target { Some(ResolvedExportInfoTargetWithCircular::Circular) => { return Some(ResolvedExportInfoTargetWithCircular::Circular); @@ -1296,7 +1367,7 @@ impl ExportInfo { resolve_filter: ResolveFilterFnTy, update_original_connection: UpdateOriginalFunctionTy, ) -> Option { - let target = self._get_target(mg, resolve_filter, &mut UkeySet::default()); + let target = self._get_target_mut(mg, resolve_filter, &mut UkeySet::default()); let target = match target { Some(ResolvedExportInfoTargetWithCircular::Circular) => return None, @@ -1630,8 +1701,6 @@ pub enum ResolvedExportInfoTargetWithCircular { pub type UpdateOriginalFunctionTy = Arc Option>; -pub type ResolveFilterFnTy = Rc bool>; - pub type UsageFilterFnTy = Box bool>; impl ExportInfoData { @@ -1700,11 +1769,13 @@ impl ExportInfoData { } } -fn resolve_target( +pub type ResolveFilterFnTy = Rc bool>; + +fn resolve_target_mut( input_target: Option, already_visited: &mut UkeySet, resolve_filter: ResolveFilterFnTy, - mg: &ModuleGraph, + mg: &mut ModuleGraph, ) -> Option { if let Some(input_target) = input_target { let mut target = ResolvedExportInfoTarget { @@ -1730,11 +1801,11 @@ fn resolve_target( }; let exports_info = mg.get_exports_info(&target.module); - let export_info = exports_info.get_read_only_export_info(mg, name); + let export_info = exports_info.get_export_info(mg, name); if already_visited.contains(&export_info) { return Some(ResolvedExportInfoTargetWithCircular::Circular); } - let new_target = export_info._get_target(mg, resolve_filter.clone(), already_visited); + let new_target = export_info._get_target_mut(mg, resolve_filter.clone(), already_visited); match new_target { Some(ResolvedExportInfoTargetWithCircular::Circular) => { @@ -1771,6 +1842,70 @@ fn resolve_target( } } +fn resolve_target( + input_target: Option, + already_visited: &mut UkeySet, + mg: &ModuleGraph, +) -> Option { + if let Some(input_target) = input_target { + let mut target = ResolvedExportInfoTarget { + module: *input_target + .dependency + .and_then(|dep_id| mg.connection_by_dependency_id(&dep_id)) + .expect("should have connection") + .module_identifier(), + export: input_target.export, + dependency: input_target.dependency.expect("should have dependency"), + }; + if target.export.is_none() { + return Some(ResolvedExportInfoTargetWithCircular::Target(target)); + } + loop { + let name = if let Some(export) = target.export.as_ref().and_then(|exports| exports.first()) { + export + } else { + return Some(ResolvedExportInfoTargetWithCircular::Target(target)); + }; + + let exports_info = mg.get_exports_info(&target.module); + let export_info = exports_info.get_read_only_export_info(mg, name); + if already_visited.contains(&export_info) { + return Some(ResolvedExportInfoTargetWithCircular::Circular); + } + let new_target = export_info._get_target(mg, already_visited); + + match new_target { + Some(ResolvedExportInfoTargetWithCircular::Circular) => { + return Some(ResolvedExportInfoTargetWithCircular::Circular); + } + None => return Some(ResolvedExportInfoTargetWithCircular::Target(target)), + Some(ResolvedExportInfoTargetWithCircular::Target(t)) => { + // SAFETY: if the target.exports is None, program will not reach here + let target_exports = target.export.as_ref().expect("should have exports"); + if target_exports.len() == 1 { + target = t; + if target.export.is_none() { + return Some(ResolvedExportInfoTargetWithCircular::Target(target)); + } + } else { + target.module = t.module; + target.dependency = t.dependency; + target.export = if let Some(mut exports) = t.export { + exports.extend_from_slice(&target_exports[1..]); + Some(exports) + } else { + Some(target_exports[1..].to_vec()) + } + } + } + } + already_visited.insert(export_info); + } + } else { + None + } +} + #[derive(Debug, PartialEq, Copy, Clone, Default, Hash, PartialOrd, Ord, Eq)] pub enum UsageState { Unused = 0, diff --git a/crates/rspack_core/src/module.rs b/crates/rspack_core/src/module.rs index e72bc05a45e..43709b91400 100644 --- a/crates/rspack_core/src/module.rs +++ b/crates/rspack_core/src/module.rs @@ -421,7 +421,7 @@ fn get_exports_type_impl( if matches!(export_info.provided(mg), Some(ExportInfoProvided::False)) { handle_default(default_object) } else { - let Some(target) = export_info.get_target(mg, None) else { + let Some(target) = export_info.get_target(mg) else { return ExportsType::Dynamic; }; if target diff --git a/crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs b/crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs index 3a8838e7791..3fad9a4c196 100644 --- a/crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs +++ b/crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs @@ -305,7 +305,7 @@ impl<'a> FlagDependencyExportsState<'a> { } // Recalculate target exportsInfo - let target = export_info.get_target(self.mg, None); + let target = export_info.get_target(self.mg); let mut target_exports_info: Option = None; if let Some(target) = target { diff --git a/crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs b/crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs index 89fe12730c9..b0606b86b9e 100644 --- a/crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs +++ b/crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs @@ -772,7 +772,7 @@ impl ModuleConcatenationPlugin { .iter() .filter(|export_info| { export_info.is_reexport(&module_graph) - && export_info.get_target(&module_graph, None).is_none() + && export_info.get_target(&module_graph).is_none() }) .copied() .collect::>(); diff --git a/crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs b/crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs index f6c4b080e7e..7344f1760b9 100644 --- a/crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs +++ b/crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs @@ -833,21 +833,23 @@ fn do_optimize_incoming_connection( let cache_clone = cache.clone(); let target = export_info.move_target( &mut module_graph, - Rc::new(move |target: &ResolvedExportInfoTarget, mg: &ModuleGraph| { - let mut cache = cache_clone.borrow_mut(); - let state = if let Some(state) = cache.get(&target.module) { - *state - } else { - let state = mg - .module_by_identifier(&target.module) - .expect("should have module") - .get_side_effects_connection_state(mg, &mut IdentifierSet::default()); - cache.insert(target.module, state); - state - }; + Rc::new( + move |target: &ResolvedExportInfoTarget, mg: &mut ModuleGraph| { + let mut cache = cache_clone.borrow_mut(); + let state = if let Some(state) = cache.get(&target.module) { + *state + } else { + let state = mg + .module_by_identifier(&target.module) + .expect("should have module") + .get_side_effects_connection_state(mg, &mut IdentifierSet::default()); + cache.insert(target.module, state); + state + }; - state == ConnectionState::Bool(false) - }), + state == ConnectionState::Bool(false) + }, + ), Arc::new( move |target: &ResolvedExportInfoTarget, mg: &mut ModuleGraph| { if !mg.update_module(&dependency_id, &target.module) { @@ -887,10 +889,10 @@ fn do_optimize_incoming_connection( let export_info = cur_exports_info.get_export_info(&mut module_graph, &ids[0]); let cache = cache.clone(); - let target = export_info.get_target( - &module_graph, - Some(Rc::new( - move |target: &ResolvedExportInfoTarget, mg: &ModuleGraph| { + let target = export_info.get_target_mut( + &mut module_graph, + Rc::new( + move |target: &ResolvedExportInfoTarget, mg: &mut ModuleGraph| { let mut cache = cache.borrow_mut(); let state = if let Some(state) = cache.get(&target.module) { *state @@ -904,7 +906,7 @@ fn do_optimize_incoming_connection( }; state == ConnectionState::Bool(false) }, - )), + ), ); let Some(target) = target else { return; diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/index.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/index.js new file mode 100644 index 00000000000..becd76457b7 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/index.js @@ -0,0 +1,5 @@ +import { Out } from "./lib/a" + +it("should generate correct export for dynamic reexports (consume shared module)", () => { + expect(Out).toBe(42) +}) diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/a.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/a.js new file mode 100644 index 00000000000..5d371e8cce9 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/a.js @@ -0,0 +1 @@ +export * from "./b" \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/b.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/b.js new file mode 100644 index 00000000000..d720ff79c20 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/b.js @@ -0,0 +1 @@ +export * from "./c" \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/c.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/c.js new file mode 100644 index 00000000000..98787a4868e --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/c.js @@ -0,0 +1 @@ +export const Out = 42; diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/package.json b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/package.json new file mode 100644 index 00000000000..a43829151e1 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/lib/package.json @@ -0,0 +1,3 @@ +{ + "sideEffects": false +} diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/rspack.config.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/rspack.config.js new file mode 100644 index 00000000000..ee0d4fbe98f --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-consume-shared/rspack.config.js @@ -0,0 +1,18 @@ +const rspack = require("@rspack/core") + +/**@type {import("@rspack/core").Configuration}*/ +module.exports = { + optimization: { + sideEffects: true, + }, + plugins: [ + new rspack.sharing.ConsumeSharedPlugin({ + consumes: { + "./lib/c.js": { + singleton: true, + eager: true, + } + } + }) + ] +}; diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/index.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/index.js new file mode 100644 index 00000000000..72ea63af61c --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/index.js @@ -0,0 +1,5 @@ +import { Out } from "./lib/a" + +it("should generate correct export for dynamic reexports (dynamic cjs)", () => { + expect(Out).toBe(42) +}) diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/a.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/a.js new file mode 100644 index 00000000000..5d371e8cce9 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/a.js @@ -0,0 +1 @@ +export * from "./b" \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/b.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/b.js new file mode 100644 index 00000000000..d720ff79c20 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/b.js @@ -0,0 +1 @@ +export * from "./c" \ No newline at end of file diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/c.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/c.js new file mode 100644 index 00000000000..f79696d7c5a --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/c.js @@ -0,0 +1,2 @@ +let e = exports; +e.Out = 42; diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/package.json b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/package.json new file mode 100644 index 00000000000..a43829151e1 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/lib/package.json @@ -0,0 +1,3 @@ +{ + "sideEffects": false +} diff --git a/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/rspack.config.js b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/rspack.config.js new file mode 100644 index 00000000000..bf18c371e0c --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/tree-shaking/side-effects-dynamic-cjs/rspack.config.js @@ -0,0 +1,6 @@ +/**@type {import("@rspack/core").Configuration}*/ +module.exports = { + optimization: { + sideEffects: true, + }, +}; diff --git a/tests/webpack-test/cases/side-effects/dynamic-reexports/index.js b/tests/webpack-test/cases/side-effects/dynamic-reexports/index.js index 775bc27fefb..b720f85ed41 100644 --- a/tests/webpack-test/cases/side-effects/dynamic-reexports/index.js +++ b/tests/webpack-test/cases/side-effects/dynamic-reexports/index.js @@ -1,78 +1,78 @@ -// import { unused, unprovided } from "./unused"; -// import { -// value as valueStatic, -// valueUsed as valueUsedStatic -// } from "./dedupe-target-static"; -// import { -// value as valueSide, -// valueUsed as valueUsedSide -// } from "./dedupe-target-with-side"; +import { unused, unprovided } from "./unused"; +import { + value as valueStatic, + valueUsed as valueUsedStatic +} from "./dedupe-target-static"; +import { + value as valueSide, + valueUsed as valueUsedSide +} from "./dedupe-target-with-side"; import { value, valueUsed } from "./dedupe-target"; -// import * as DefaultExport from "./default-export"; -// import { -// value as valueDirect, -// value2 as value2Direct, -// default as Default1 -// } from "./direct-export"; -// import { -// value as valueChecked, -// value2 as value2Checked -// } from "./checked-export"; -// import Default2 from "./dynamic-reexport-default"; -// import { -// value as valueMultipleSources, -// value2 as value2MultipleSources -// } from "./multiple-sources"; -// import { a, b } from "./swapped"; +import * as DefaultExport from "./default-export"; +import { + value as valueDirect, + value2 as value2Direct, + default as Default1 +} from "./direct-export"; +import { + value as valueChecked, + value2 as value2Checked +} from "./checked-export"; +import Default2 from "./dynamic-reexport-default"; +import { + value as valueMultipleSources, + value2 as value2MultipleSources +} from "./multiple-sources"; +import { a, b } from "./swapped"; -// it("should dedupe static reexport target", () => { -// expect(valueStatic).toBe(42); -// expect(valueUsedStatic).toBe(unused); -// }); +it("should dedupe static reexport target", () => { + expect(valueStatic).toBe(42); + expect(valueUsedStatic).toBe(unused); +}); it("should dedupe dynamic reexport target", () => { expect(value).toBe(undefined); expect(valueUsed).toBe(unused); }); -// it("should not dedupe dynamic reexport target when it has side-effects", () => { -// expect(valueSide).toBe(undefined); -// expect(valueUsedSide).toBe(true); -// }); -// -// it("should optimize dynamic default reexport", () => { -// expect(DefaultExport.a).toBe(42); -// expect(DefaultExport.b).toBe(42); -// expect(DefaultExport.empty).toEqual({}); -// expect(DefaultExport.json).toBe(42); -// }); -// -// it("should handle default export when reexporting", () => { -// const module = Object(require("./reexports-excludes-default")); -// expect(module.defaultProvided).toBe(unprovided); -// }); -// -// it("should handle direct export when reexporting", () => { -// expect(valueDirect).toBe(42); -// expect(value2Direct).toBe(42); -// }); -// -// it("should handle checked dynamic export when reexporting", () => { -// expect(valueChecked).toBe(42); -// expect(value2Checked).toBe(42); -// }); -// -// it("should handle default export correctly", () => { -// expect(Default1).toBe(undefined); -// expect(Default2).toBe("static"); -// }); -// -// it("should handle multiple dynamic sources correctly", () => { -// expect(valueMultipleSources).toBe(42); -// expect(value2MultipleSources).toBe(42); -// }); -// -// it("should handle renamed dynamic reexports", () => { -// expect(a).toBe(43); -// expect(b).toBe(42); -// }); +it("should not dedupe dynamic reexport target when it has side-effects", () => { + expect(valueSide).toBe(undefined); + expect(valueUsedSide).toBe(true); +}); + +it("should optimize dynamic default reexport", () => { + expect(DefaultExport.a).toBe(42); + expect(DefaultExport.b).toBe(42); + expect(DefaultExport.empty).toEqual({}); + expect(DefaultExport.json).toBe(42); +}); + +it("should handle default export when reexporting", () => { + const module = Object(require("./reexports-excludes-default")); + expect(module.defaultProvided).toBe(unprovided); +}); + +it("should handle direct export when reexporting", () => { + expect(valueDirect).toBe(42); + expect(value2Direct).toBe(42); +}); + +it("should handle checked dynamic export when reexporting", () => { + expect(valueChecked).toBe(42); + expect(value2Checked).toBe(42); +}); + +it("should handle default export correctly", () => { + expect(Default1).toBe(undefined); + expect(Default2).toBe("static"); +}); + +it("should handle multiple dynamic sources correctly", () => { + expect(valueMultipleSources).toBe(42); + expect(value2MultipleSources).toBe(42); +}); + +it("should handle renamed dynamic reexports", () => { + expect(a).toBe(43); + expect(b).toBe(42); +}); diff --git a/tests/webpack-test/cases/side-effects/dynamic-reexports/test.config.js b/tests/webpack-test/cases/side-effects/dynamic-reexports/test.config.js deleted file mode 100644 index 1e98ef84280..00000000000 --- a/tests/webpack-test/cases/side-effects/dynamic-reexports/test.config.js +++ /dev/null @@ -1,9 +0,0 @@ -/**@type {import("@rspack/cli").Configuration} */ -const config = { - - - optimization: { - sideEffects: true, - }, -}; -module.exports = config; diff --git a/tests/webpack-test/cases/side-effects/dynamic-reexports/test.filter.js b/tests/webpack-test/cases/side-effects/dynamic-reexports/test.filter.js deleted file mode 100644 index 2c0b41238d9..00000000000 --- a/tests/webpack-test/cases/side-effects/dynamic-reexports/test.filter.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = () => {return false} - -