@@ -17,47 +17,6 @@ var pluginSchema = require('./schema/plugin-schema.json');
1717var NS = fs . realpathSync ( __dirname ) ;
1818var nextId = 0 ;
1919
20- function isChunk ( chunk , error ) {
21- if ( ! ( chunk instanceof Chunk ) ) {
22- throw new Error ( typeof error === 'string' ? error : 'chunk is not an instance of Chunk' ) ;
23- }
24-
25- return true ;
26- }
27-
28- function forEachChunkModule ( chunk , cb ) {
29- isChunk ( chunk ) ;
30-
31- // webpack >= 3.x.x
32- if ( typeof chunk . forEachModule === 'function' ) {
33- chunk . forEachModule ( cb ) ;
34- }
35- else {
36- // webpack < 3.x.x
37- chunk . modules . forEach ( cb ) ;
38- }
39-
40- // Nothing better to return...
41- return chunk ;
42- }
43-
44- function getChunkModulesArray ( chunk ) {
45- isChunk ( chunk ) ;
46-
47- var arr = [ ] ;
48-
49- // webpack >= 3.x.x
50- if ( typeof chunk . mapModules === 'function' ) {
51- arr = chunk . mapModules ( ) ;
52- }
53- else {
54- // webpack < 3.x.x
55- arr = chunk . modules . slice ( ) ;
56- }
57-
58- return arr ;
59- }
60-
6120function ExtractTextPluginCompilation ( ) {
6221 this . modulesByIdentifier = { } ;
6322}
@@ -395,3 +354,44 @@ function getPath(compilation, source, chunk) {
395354 } ) ;
396355 }
397356}
357+
358+ function isChunk ( chunk , error ) {
359+ if ( ! ( chunk instanceof Chunk ) ) {
360+ throw new Error ( typeof error === 'string' ? error : 'chunk is not an instance of Chunk' ) ;
361+ }
362+
363+ return true ;
364+ }
365+
366+ function forEachChunkModule ( chunk , cb ) {
367+ isChunk ( chunk ) ;
368+
369+ // webpack >= 3.x.x
370+ if ( typeof chunk . forEachModule === 'function' ) {
371+ chunk . forEachModule ( cb ) ;
372+ }
373+ else {
374+ // webpack < 3.x.x
375+ chunk . modules . forEach ( cb ) ;
376+ }
377+
378+ // Nothing better to return...
379+ return chunk ;
380+ }
381+
382+ function getChunkModulesArray ( chunk ) {
383+ isChunk ( chunk ) ;
384+
385+ var arr = [ ] ;
386+
387+ // webpack >= 3.x.x
388+ if ( typeof chunk . mapModules === 'function' ) {
389+ arr = chunk . mapModules ( ) ;
390+ }
391+ else {
392+ // webpack < 3.x.x
393+ arr = chunk . modules . slice ( ) ;
394+ }
395+
396+ return arr ;
397+ }
0 commit comments