Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 6623153

Browse files
committed
fix(webpack): plugin should only modify js chunks
otherwise, we end up with an `XMLHttpRequest is not defined` error when HtmlWebpackPlugin is enabled. should solve #18
1 parent 70a8f01 commit 6623153

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/typewiz-webpack/src/plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export class TypewizPlugin {
4141
private wrapChunks(compilation: Compilation, chunks: IChunk[]) {
4242
chunks.forEach((chunk) => {
4343
chunk.files.forEach((fileName) => {
44-
this.wrapFile(compilation, fileName);
44+
if (/\.js$/i.test(fileName)) {
45+
this.wrapFile(compilation, fileName);
46+
}
4547
});
4648
});
4749
}

0 commit comments

Comments
 (0)