Skip to content

Commit 59f54a6

Browse files
committed
Create patch for karma-webpack to resolve "no such file or directory"
1 parent 0ee05bc commit 59f54a6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

patches/karma-webpack+5.0.0.patch

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/node_modules/karma-webpack/lib/webpack/plugin.js b/node_modules/karma-webpack/lib/webpack/plugin.js
2+
index 47b993c..3b75a9e 100644
3+
--- a/node_modules/karma-webpack/lib/webpack/plugin.js
4+
+++ b/node_modules/karma-webpack/lib/webpack/plugin.js
5+
@@ -1,4 +1,5 @@
6+
const fs = require('fs');
7+
+const path = require('path');
8+
9+
class KW_WebpackPlugin {
10+
constructor(options) {
11+
@@ -14,9 +15,10 @@ class KW_WebpackPlugin {
12+
// read generated file content and store for karma preprocessor
13+
this.controller.bundlesContent = {};
14+
stats.toJson().assets.forEach((webpackFileObj) => {
15+
- const filePath = `${compiler.options.output.path}/${
16+
+ const filePath = path.resolve(
17+
+ compiler.options.output.path,
18+
webpackFileObj.name
19+
- }`;
20+
+ );
21+
this.controller.bundlesContent[webpackFileObj.name] = fs.readFileSync(
22+
filePath,
23+
'utf-8'

0 commit comments

Comments
 (0)