Skip to content

Commit 285a377

Browse files
committed
add import.meta
1 parent 7f24660 commit 285a377

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/js_native_api_v8.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,9 @@ napi_status NAPI_CDECL napi_create_environment(napi_platform platform,
887887
"const internalLoader = new ESMLoader;"
888888
"const parent_path = require('url').pathToFileURL(process.argv[0]);"
889889
"global.import = (mod) => internalLoader.import(mod, parent_path, "
890-
"Object.create(null));";
890+
"Object.create(null));"
891+
"global.import.meta = { url: parent_path };"
892+
;
891893

892894
auto wrapper = reinterpret_cast<v8impl::PlatformWrapper*>(platform);
893895
std::vector<std::string> errors_vec;

0 commit comments

Comments
 (0)