File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ Chunk.prototype.addBlock = function(block) {
6868 return true ;
6969} ;
7070
71+ Chunk . prototype . addOrigin = function ( module , loc ) {
72+ this . origins . push ( { module : module , loc : loc , name : this . name } ) ;
73+ } ;
74+
7175Chunk . prototype . remove = function ( reason ) {
7276 // console.log("remove " + this.toString());
7377 this . modules . slice ( ) . forEach ( function ( m ) {
Original file line number Diff line number Diff line change @@ -410,8 +410,11 @@ Compilation.prototype.seal = function seal(callback) {
410410
411411Compilation . prototype . addChunk = function addChunk ( name , module , loc ) {
412412 if ( name ) {
413- if ( Object . prototype . hasOwnProperty . call ( this . namedChunks , name ) )
414- return this . namedChunks [ name ] ;
413+ if ( Object . prototype . hasOwnProperty . call ( this . namedChunks , name ) ) {
414+ var chunk = this . namedChunks [ name ] ;
415+ if ( module ) chunk . addOrigin ( module , loc ) ;
416+ return chunk ;
417+ }
415418 }
416419 var chunk = new Chunk ( name , module , loc ) ;
417420 this . chunks . push ( chunk ) ;
You can’t perform that action at this time.
0 commit comments