File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const getRelativePath = (filePath) => {
1010}
1111
1212const emitHandle = ( compilation , callback ) => {
13- compilation . entrypoints . forEach ( ( { chunks} ) => {
13+ function chunksHandle ( chunks ) {
1414 const entryChunk = chunks . pop ( )
1515
1616 entryChunk . files . forEach ( filePath => {
@@ -39,7 +39,17 @@ const emitHandle = (compilation, callback) => {
3939 assetFile . source = ( ) => content
4040 } )
4141 } )
42- } )
42+ }
43+
44+ if ( compilation . entrypoints instanceof Map ) {
45+ compilation . entrypoints . forEach ( ( { chunks} ) => chunksHandle ( chunks ) )
46+ } else {
47+ Object . keys ( compilation . entrypoints ) . forEach ( key => {
48+ const { chunks } = compilation . entrypoints [ key ]
49+ chunksHandle ( chunks )
50+ } )
51+ }
52+
4353 callback ( )
4454}
4555
You can’t perform that action at this time.
0 commit comments