@@ -38,23 +38,24 @@ use swc_experimental_ecma_semantic::resolver::{Semantic, resolver};
3838use swc_node_comments:: SwcComments ;
3939
4040use crate :: {
41- AsyncDependenciesBlockIdentifier , BoxDependency , BoxDependencyTemplate , BoxModuleDependency ,
42- BuildContext , BuildInfo , BuildMeta , BuildMetaDefaultObject , BuildMetaExportsType , BuildResult ,
43- ChunkGraph , ChunkInitFragments , ChunkRenderContext , CodeGenerationDataTopLevelDeclarations ,
44- CodeGenerationExportsFinalNames , CodeGenerationPublicPathAutoReplace , CodeGenerationResult ,
45- Compilation , ConcatenatedModuleIdent , ConcatenationScope , ConditionalInitFragment ,
46- ConnectionState , Context , DEFAULT_EXPORT , DEFAULT_EXPORT_ATOM , DependenciesBlock , DependencyId ,
47- DependencyType , ExportInfoHashKey , ExportProvided , ExportsArgument , ExportsInfoGetter ,
48- ExportsType , FactoryMeta , GetUsedNameParam , ImportedByDeferModulesArtifact , InitFragment ,
49- InitFragmentStage , LibIdentOptions , Module , ModuleArgument , ModuleCodeGenerationContext ,
50- ModuleGraph , ModuleGraphCacheArtifact , ModuleGraphConnection , ModuleIdentifier , ModuleLayer ,
51- ModuleStaticCache , ModuleType , NAMESPACE_OBJECT_EXPORT , ParserOptions , PrefetchExportsInfoMode ,
52- Resolve , RuntimeCondition , RuntimeGlobals , RuntimeSpec , SourceType , URLStaticMode , UsageState ,
53- UsedName , UsedNameItem , escape_identifier, filter_runtime, find_target, get_runtime_key,
54- impl_source_map_config, merge_runtime_condition, merge_runtime_condition_non_false,
55- module_update_hash, property_access, property_name,
56- render_make_deferred_namespace_mode_from_exports_type, reserved_names:: RESERVED_NAMES ,
57- subtract_runtime_condition, to_identifier_with_escaped, to_normal_comment,
41+ AsyncDependenciesBlockIdentifier , BoxDependency , BoxDependencyTemplate , BoxModule ,
42+ BoxModuleDependency , BuildContext , BuildInfo , BuildMeta , BuildMetaDefaultObject ,
43+ BuildMetaExportsType , BuildResult , ChunkGraph , ChunkInitFragments , ChunkRenderContext ,
44+ CodeGenerationDataTopLevelDeclarations , CodeGenerationExportsFinalNames ,
45+ CodeGenerationPublicPathAutoReplace , CodeGenerationResult , Compilation , ConcatenatedModuleIdent ,
46+ ConcatenationScope , ConditionalInitFragment , ConnectionState , Context , DEFAULT_EXPORT ,
47+ DEFAULT_EXPORT_ATOM , DependenciesBlock , DependencyId , DependencyType , ExportInfoHashKey ,
48+ ExportProvided , ExportsArgument , ExportsInfoGetter , ExportsType , FactoryMeta , GetUsedNameParam ,
49+ ImportedByDeferModulesArtifact , InitFragment , InitFragmentStage , LibIdentOptions , Module ,
50+ ModuleArgument , ModuleCodeGenerationContext , ModuleGraph , ModuleGraphCacheArtifact ,
51+ ModuleGraphConnection , ModuleIdentifier , ModuleLayer , ModuleStaticCache , ModuleType ,
52+ NAMESPACE_OBJECT_EXPORT , ParserOptions , PrefetchExportsInfoMode , Resolve , RuntimeCondition ,
53+ RuntimeGlobals , RuntimeSpec , SourceType , URLStaticMode , UsageState , UsedName , UsedNameItem ,
54+ escape_identifier, filter_runtime, find_target, get_runtime_key, impl_source_map_config,
55+ merge_runtime_condition, merge_runtime_condition_non_false, module_update_hash, property_access,
56+ property_name, render_make_deferred_namespace_mode_from_exports_type,
57+ reserved_names:: RESERVED_NAMES , subtract_runtime_condition, to_identifier_with_escaped,
58+ to_normal_comment,
5859} ;
5960
6061type ExportsDefinitionArgs = Vec < ( String , String ) > ;
@@ -742,7 +743,7 @@ impl Module for ConcatenatedModule {
742743
743744 /// the compilation is asserted to be `Some(Compilation)`, https://github.com/webpack/webpack/blob/1f99ad6367f2b8a6ef17cce0e058f7a67fb7db18/lib/optimize/ModuleConcatenationPlugin.js#L394-L418
744745 async fn build (
745- & mut self ,
746+ mut self : Box < Self > ,
746747 _build_context : BuildContext ,
747748 compilation : Option < & Compilation > ,
748749 ) -> Result < BuildResult > {
@@ -810,7 +811,12 @@ impl Module for ConcatenatedModule {
810811 . extend ( module_build_info. assets . as_ref ( ) . clone ( ) ) ;
811812 }
812813 // return a dummy result is enough, since we don't build the ConcatenatedModule in make phase
813- Ok ( BuildResult :: default ( ) )
814+ Ok ( BuildResult {
815+ module : BoxModule :: new ( self ) ,
816+ dependencies : vec ! [ ] ,
817+ blocks : vec ! [ ] ,
818+ optimization_bailouts : vec ! [ ] ,
819+ } )
814820 }
815821
816822 // #[tracing::instrument("ConcatenatedModule::code_generation", skip_all, fields(identifier = ?self.identifier()))]
0 commit comments