File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 8
8
"use strict" ;
9
9
10
10
const requireIndex = require ( "requireindex" ) ;
11
+ const path = require ( "node:path" ) ;
11
12
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" ) ;
13
+ const pathParts = __dirname . split ( path . sep ) ;
14
+ const pkg =
15
+ pathParts [ pathParts . length - 1 ] === "dist"
16
+ ? // @ts -expect-error -- TODO: ESM/TypeScript conversion should fix this.
17
+ require ( "../package.json" ) // eslint-disable-line n/no-missing-require -- this is the path when this file is compiled to dist/
18
+ : // @ts -expect-error -- TODO: ESM/TypeScript conversion should fix this.
19
+ require ( "./package.json" ) ;
17
20
18
21
module . exports = {
19
22
meta : {
You can’t perform that action at this time.
0 commit comments