File tree Expand file tree Collapse file tree 8 files changed +68
-263
lines changed
core/src/inner-plugins/plugins
graph/src/transform/module-graph Expand file tree Collapse file tree 8 files changed +68
-263
lines changed Original file line number Diff line number Diff line change 1919 },
2020 "devDependencies" : {
2121 "@rsdoctor/rspack-plugin" : " workspace:*" ,
22- "@rspack/cli" : " 1.4.11 " ,
23- "@rspack/core" : " 1.4.11 " ,
24- "@rspack/plugin-react-refresh" : " 1.4.3 " ,
22+ "@rspack/cli" : " 1.6.1 " ,
23+ "@rspack/core" : " 1.6.1 " ,
24+ "@rspack/plugin-react-refresh" : " 1.5.2 " ,
2525 "@types/react" : " ^18.0.25" ,
2626 "@types/react-dom" : " ^18.0.8" ,
2727 "react-refresh" : " ^0.14.0" ,
Original file line number Diff line number Diff line change 1818 },
1919 "devDependencies" : {
2020 "@rsdoctor/rspack-plugin" : " workspace:*" ,
21- "@rspack/cli" : " 1.4.11 " ,
22- "@rspack/core" : " 1.4.11 " ,
23- "@rspack/plugin-react-refresh" : " ^1.4.3 " ,
21+ "@rspack/cli" : " 1.6.1 " ,
22+ "@rspack/core" : " 1.6.1 " ,
23+ "@rspack/plugin-react-refresh" : " ^1.5.2 " ,
2424 "@types/react" : " ^18.0.25" ,
2525 "@types/react-dom" : " ^18.0.8" ,
2626 "react-refresh" : " ^0.14.0" ,
Original file line number Diff line number Diff line change 2121 },
2222 "devDependencies" : {
2323 "@rsdoctor/rspack-plugin" : " workspace:*" ,
24- "@rspack/cli" : " 1.4.11 " ,
25- "@rspack/core" : " 1.4.11 " ,
26- "@rspack/plugin-react-refresh" : " ^1.4.3 " ,
24+ "@rspack/cli" : " 1.6.1 " ,
25+ "@rspack/core" : " 1.6.1 " ,
26+ "@rspack/plugin-react-refresh" : " ^1.5.2 " ,
2727 "@types/react" : " ^18.0.25" ,
2828 "@types/react-dom" : " ^18.0.8" ,
2929 "react-refresh" : " ^0.14.0" ,
Original file line number Diff line number Diff line change @@ -15,16 +15,7 @@ export class InternalBundlePlugin<
1515 try {
1616 // bundle depends on module graph
1717 this . scheduler . ensureModulesChunksGraphApplied ( compiler ) ;
18-
19- compiler . hooks . compilation . tap (
20- {
21- name : 'ChangeDevtoolModuleFilename' ,
22- stage : - 100 ,
23- } ,
24- ( ) => {
25- this . changeDevtoolModuleFilename ( compiler ) ;
26- } ,
27- ) ;
18+ this . changeDevtoolModuleFilename ( compiler ) ;
2819
2920 compiler . hooks . compilation . tap ( this . tapPostOptions , this . thisCompilation ) ;
3021 compiler . hooks . done . tapPromise ( this . tapPreOptions , this . done . bind ( this ) ) ;
@@ -51,7 +42,7 @@ export class InternalBundlePlugin<
5142 ) ;
5243
5344 if ( devtool . includes ( 'source-map' ) ) {
54- compiler . options . output . devtoolFallbackModuleFilenameTemplate =
45+ compiler . options . output . devtoolFallbackModuleFilenameTemplate = ( ) =>
5546 '[absolute-resource-path]' ;
5647 }
5748 }
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ export async function collectSourceMaps(
9797
9898 // Group all mappings by generated line number
9999 const lineMappings = new Map < number , Array < MappingItem > > ( ) ;
100+ // @ts -ignore consumer._absoluteSources maybe has problem.
101+ consumer . _absoluteSources = consumer . _sources ;
102+
100103 consumer . eachMapping ( ( m : MappingItem ) => {
101104 if ( ! lineMappings . has ( m . generatedLine ) ) {
102105 lineMappings . set ( m . generatedLine , [ ] ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,13 @@ function getModulesFromChunks(
5252) {
5353 chunks ?. forEach ( ( chunk ) => {
5454 if ( chunk . modules ?. length ) {
55- collectedModules . push ( ...chunk . modules ) ;
55+ collectedModules . push (
56+ ...chunk . modules . map ( ( module ) => ( {
57+ ...module ,
58+ identifier : module . identifier ?? module . moduleIdentifier ,
59+ name : module . name ?? module . moduleName ,
60+ } ) ) ,
61+ ) ;
5662 }
5763 } ) ;
5864}
@@ -88,7 +94,7 @@ export function getModuleGraphByStats(
8894
8995 const isConcatenated = Boolean ( data . modules && data . modules . length > 0 ) ;
9096 const concatenatedModule = new Module (
91- data . identifier ! ,
97+ data . identifier ?? data . moduleIdentifier ! ,
9298 getGetModuleName ( root , data ) ,
9399 data . depth === 0 ,
94100 isConcatenated ? SDK . ModuleKind . Concatenation : SDK . ModuleKind . Normal ,
Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ export interface StatsModule {
5858 type ?: string ;
5959 moduleType ?: string ;
6060 identifier ?: string ;
61+ moduleIdentifier ?: string ;
6162 name ?: string ;
63+ moduleName ?: string ;
6264 id ?: string | number ;
6365 chunks ?: Array < string | number > ;
6466 size ?: number ;
You can’t perform that action at this time.
0 commit comments