Skip to content

Commit 62be401

Browse files
authored
Merge pull request #481 from open-rpc/fix/resolve-html-reporter-react
Fixed resolve for html reporter react
2 parents b376713 + 59acdb7 commit 62be401

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"author": "",
1919
"license": "Apache-2.0",
2020
"dependencies": {
21-
"@open-rpc/html-reporter-react": "^0.0.3",
21+
"@open-rpc/html-reporter-react": "^0.0.4",
2222
"@open-rpc/schema-utils-js": "^1.16.2",
2323
"@types/isomorphic-fetch": "0.0.35",
2424
"@types/lodash": "^4.14.162",

src/reporters/html-reporter.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,14 @@ class HtmlReporter implements Reporter {
3131
rule: c.rule?.getTitle(),
3232
};
3333
});
34-
const htmlReportAppPath = path.resolve(
35-
__dirname,
36-
"../../node_modules/@open-rpc/html-reporter-react/"
37-
);
34+
const htmlReportAppPath = require.resolve("@open-rpc/html-reporter-react");
3835
const destinationPath = this.destination + "/index.html";
3936

4037
await fs.promises.mkdir(this.destination, { recursive: true });
4138

4239
// Copying the HTML file to the desired directory.
4340
await fs.promises.copyFile(
44-
`${htmlReportAppPath}/dist/index.html`,
41+
htmlReportAppPath.replace("index.js", "index.html"),
4542
destinationPath
4643
);
4744

0 commit comments

Comments
 (0)