endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

Support `import.meta.url` and `require.resolve` #1153

Open naugtur opened 2 years ago

naugtur commented 2 years ago

Use-cases

The goal of this is to collect requirements for the feature

import.meta.url

require.resolve

Requirements

import.meta

running from live filesystem (loadLocation)

running form bundle/archive

require.resolve require.cache

running from live filesystem (loadLocation)

running form bundle/archive

Work

kriskowal commented 2 years ago

See: https://github.com/endojs/endo/issues/291

kriskowal commented 10 months ago

I’ll note that import.meta.resolve is now specified to be synchronous, which we can support because we know where all the dependency packages are before we run JS.