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 88"use strict" ;
99
1010const requireIndex = require ( "requireindex" ) ;
11+ const path = require ( "node:path" ) ;
1112
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" ) ;
1720
1821module . exports = {
1922 meta : {
You can’t perform that action at this time.
0 commit comments