Is it possible to load a sub app using `type="module"` script tag when the master app doesn't use `type="module"` script tag
See original GitHub issueIs it possible to load a sub app using type="module
script tag when the master app doesn’t use type="module
script tag?
After some researching I found it seems currently qiankun uses eval
to execute scripts of sub apps via import-html-entry
module, which means when the javascript context of the master app isn’t a module, the javascript context of sub apps can’t use module syntax either, which is a big limitation in MICRO FRONTEND architecture.
I wonder if it’s possible to use any other ways to executing scripts instead of using eval
, e.g. inserting a inline script element to the sub app?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Dynamically loading a module that is not in a script tag with ...
Yes you can, as long as your loader script is marked as module <script type="module"> const moduleSpecifier = '.
Read more >JavaScript modules via script tag | Can I use... Support tables ...
Loading JavaScript module scripts (aka ES6 modules) using <script type="module"> Includes support for the nomodule attribute. Usage % of. all users, all tracked ......
Read more >How to Include three.js in Your Projects
The first step in building a three.js app is importing the three.js files. There are three main ways to do this: download the...
Read more >The Script element - HTML: HyperText Markup Language
The <script> HTML element is used to embed executable code or data; ... <script type="module" src="main.js"></script> <script nomodule ...
Read more >Bundling and Building with Parcel - Beginner JavaScript
So the idea with modules is eventually we will be able to ship this script tag to the browser. Meaning we can upload...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lalaze Not yet, still waiting for responses from maintainers.
@kuitos I have a similar question. I built a Vue3 subapplication using Vite. And the subapplication page has wrote “<script type="module" src="//localhost:3000/main.js" entry></script>”。 But the console keeps reporting errors. “Cannot use Import Statement outside a Module”