Open flancer64 opened 4 years ago
I try to load libs with import():
import()
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script> function bootstrap() { // load all libraries then create & start application Promise.all([ import("./lib/http_vue_loader.js"), import("./lib/vue-router.js"), import("./lib/vue_esm_browser.js"), ]).then(([modLoader, modRouter, modVue, ...other]) => { debugger; }); } window.addEventListener("load", () => bootstrap()); </script> </head> <body> </body> </html>
but root is undefined in this case:
root
(function umd(root,factory){ if(typeof module==='object' && typeof exports === 'object' ) module.exports=factory() else if(typeof define==='function' && define.amd) define([],factory) else root.httpVueLoader=factory() })(this,function factory() {...});
and I have an error "Cannot set property 'httpVueLoader' of undefined" at
root.httpVueLoader=factory()
vue-router.js uses self in the same situation.
vue-router.js
I try to load libs with
import()
:but
root
is undefined in this case:and I have an error "Cannot set property 'httpVueLoader' of undefined" at
vue-router.js
uses self in the same situation.