Created
May 28, 2020 23:31
-
-
Save kriskowal/a3d8a93819a020edc0d88c00ac162f63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dependency = new Compartment({}, {}, { | |
resolveHook: (moduleSpecifier, moduleReferrer) => | |
resolve(moduleSpecifier, moduleReferrer), | |
importHook: async moduleSpecifier => { | |
const moduleLocation = locate(moduleSpecifier); | |
const moduleText = await retrieve(moduleLocation); | |
return new ModuleStaticRecord(moduleText, moduleLocation); | |
}, | |
}); | |
const application = new Compartment({}, { | |
'dependency': dependency.module('./main.js'), | |
}, { | |
resolveHook, | |
importHook, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment