From f96244f52656c9b515cae70636a70d739711f93c Mon Sep 17 00:00:00 2001 From: Victor Korzunin Date: Sun, 22 Apr 2018 22:19:05 +0300 Subject: [PATCH] Handle fileDependencies object as a Set to have it worked with webpack 4 --- packages/kotlin-webpack-plugin/plugin.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/kotlin-webpack-plugin/plugin.js b/packages/kotlin-webpack-plugin/plugin.js index 8bff5364..6c472957 100644 --- a/packages/kotlin-webpack-plugin/plugin.js +++ b/packages/kotlin-webpack-plugin/plugin.js @@ -158,7 +158,14 @@ class KotlinWebpackPlugin { absolute: true, }).then(paths => { const normalizedPaths = paths.map(it => path.normalize(it)); - compilation.fileDependencies.push(...normalizedPaths); + if (compilation.fileDependencies.add) { + for (const path of normalizedPaths) { + compilation.fileDependencies.add(path); + } + } else { + // Before Webpack 4 - fileDepenencies was an array + compilation.fileDependencies.push(...normalizedPaths); + } done(); }); }