Skip to content

Commit f96244f

Browse files
committed
Handle fileDependencies object as a Set to have it worked with webpack 4
1 parent c3ac836 commit f96244f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/kotlin-webpack-plugin/plugin.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,14 @@ class KotlinWebpackPlugin {
158158
absolute: true,
159159
}).then(paths => {
160160
const normalizedPaths = paths.map(it => path.normalize(it));
161-
compilation.fileDependencies.push(...normalizedPaths);
161+
if (compilation.fileDependencies.add) {
162+
for (const path of normalizedPaths) {
163+
compilation.fileDependencies.add(path);
164+
}
165+
} else {
166+
// Before Webpack 4 - fileDepenencies was an array
167+
compilation.fileDependencies.push(...normalizedPaths);
168+
}
162169
done();
163170
});
164171
}

0 commit comments

Comments
 (0)