We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b463530 commit 0820967Copy full SHA for 0820967
index.js
@@ -10,7 +10,7 @@ const getRelativePath = (filePath) => {
10
}
11
12
const emitHandle = (compilation, callback) => {
13
- compilation.entrypoints.forEach(({chunks}) => {
+ function chunksHandle(chunks) {
14
const entryChunk = chunks.pop()
15
16
entryChunk.files.forEach(filePath => {
@@ -39,7 +39,17 @@ const emitHandle = (compilation, callback) => {
39
assetFile.source = () => content
40
})
41
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
53
callback()
54
55
0 commit comments