diff --git a/index.js b/index.js index 0d30b0d..3cf773b 100755 --- a/index.js +++ b/index.js @@ -134,7 +134,11 @@ class MergeIntoFile { const chunk = compilation.addChunk(fileId); chunk.id = fileId; chunk.ids = [chunk.id]; - chunk.files.push(newFileNameHashed); + if (chunk.files instanceof Set) { + chunk.files.add(newFileNameHashed); + } else { + chunk.files.push(newFileNameHashed); + } } } generatedFiles[newFileName] = newFileNameHashed; diff --git a/index.node6-compatible.js b/index.node6-compatible.js index efddee7..026b021 100644 --- a/index.node6-compatible.js +++ b/index.node6-compatible.js @@ -267,7 +267,12 @@ var MergeIntoFile = /*#__PURE__*/function () { var chunk = compilation.addChunk(fileId); chunk.id = fileId; chunk.ids = [chunk.id]; - chunk.files.push(newFileNameHashed); + + if (chunk.files instanceof Set) { + chunk.files.add(newFileNameHashed); + } else { + chunk.files.push(newFileNameHashed); + } } }