diff --git a/crates/rspack_plugin_javascript/src/dependency/esm/harmony_export_imported_specifier_dependency.rs b/crates/rspack_plugin_javascript/src/dependency/esm/harmony_export_imported_specifier_dependency.rs index b9b2bfa74ee1..2759456c0ed4 100644 --- a/crates/rspack_plugin_javascript/src/dependency/esm/harmony_export_imported_specifier_dependency.rs +++ b/crates/rspack_plugin_javascript/src/dependency/esm/harmony_export_imported_specifier_dependency.rs @@ -468,16 +468,22 @@ impl HarmonyExportImportedSpecifierDependency { let mut fragments = vec![]; let mg = &compilation.module_graph; // FIXME: - // let connection = mg.connection_by_dependency(&self.id); - println!( - "self.id {:?} {:?}", - &self.id, - mg.get_module(&self.id), - // connection.unwrap().module_identifier - ); + // let data = mg + // .get_module(&self.id) + // .unwrap() + // .as_normal_module() + // .and_then(|m| Some(m.resource_resolved_data())); + // if let Some(data) = data { + // let resource_path = &data.resource_path; + // println!("resource_path {:?}", resource_path) + // } let imported_module = mg .module_identifier_by_dependency_id(&self.id) - .expect("should have imported module identifier"); + .unwrap_or_else(|| { + println!("resource_path {:?} {:?}", module.identifier(), &self); + panic!(); + }); + // .expect("should have imported module identifier"); let module_identifier = module.identifier(); let import_var = get_import_var(mg, self.id); match mode.ty { diff --git a/packages/create-rspack/template-react-ts/rspack.config.js b/packages/create-rspack/template-react-ts/rspack.config.js index dd4ba9b94f8f..18f70679516f 100644 --- a/packages/create-rspack/template-react-ts/rspack.config.js +++ b/packages/create-rspack/template-react-ts/rspack.config.js @@ -59,13 +59,13 @@ module.exports = { } ] }, - // optimization: { - // sideEffects: true, - // usedExports: true, - // providedExports: true, - // mangleExports: true, - // moduleIds: 'named' - // }, + optimization: { + sideEffects: "flag", + usedExports: true, + providedExports: true, + mangleExports: true, + moduleIds: "named" + }, experiments: { rspackFuture: { newTreeshaking: true