Skip to content

Commit e508d75

Browse files
committed
Fix makeRemovedFSAssert() resolved path
1 parent 97cba27 commit e508d75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/parseTools.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import * as path from 'node:path';
1212
import {existsSync} from 'node:fs';
1313
import assert from 'node:assert';
14+
import {fileURLToPath} from 'node:url';
1415

1516
import {
1617
addToCompileTimeContext,
@@ -921,7 +922,12 @@ function makeModuleReceiveWithVar(localName, moduleName, defaultValue) {
921922
function makeRemovedFSAssert(fsName) {
922923
assert(ASSERTIONS);
923924
const lower = fsName.toLowerCase();
924-
if (JS_LIBRARIES.includes(path.resolve(path.join('lib', `lib${lower}.js`)))) return '';
925+
if (
926+
JS_LIBRARIES.includes(
927+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'lib', `lib${lower}.js`),
928+
)
929+
)
930+
return '';
925931
return `var ${fsName} = '${fsName} is no longer included by default; build with -l${lower}.js';`;
926932
}
927933

0 commit comments

Comments
 (0)