Skip to content

Commit f470c11

Browse files
authored
fix: package.json path (#584)
1 parent 2295f13 commit f470c11

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
const requireIndex = require("requireindex");
1111

12-
// @ts-expect-error -- ESM/TypeScript conversion should fix this.
13-
const pkg = require("./package.json");
12+
const pkg = __dirname.includes("/dist/")
13+
? // @ts-expect-error -- TODO: ESM/TypeScript conversion should fix this.
14+
require("../package.json") // eslint-disable-line n/no-missing-require -- this is the path when this file is compiled to dist/
15+
: // @ts-expect-error -- TODO: ESM/TypeScript conversion should fix this.
16+
require("./package.json");
1417

1518
module.exports = {
1619
meta: {

0 commit comments

Comments
 (0)