Open naugtur opened 2 years ago
The goal of this is to collect requirements for the feature
const require = createRequire(import.meta.url); __dirname = fileURLToPath(import.meta.url);
const LOADER = new URL('shared-worker-loader.js', import.meta.url);
delete require.cache[require.resolve('../src/sha3.js')];
loadLocation
See: https://github.com/endojs/endo/issues/291
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.
import.meta.resolve
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