-
Notifications
You must be signed in to change notification settings - Fork 281
(BREAKING) Change Webpack config to output real ESM modules #1393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,12 @@ declare global { | |
| * The build number of the app shell. Set when the app shell is built by webpack. | ||
| */ | ||
| spaVersion: string; | ||
| /** | ||
| * Globals added by the @single-spa/import-map-injector package. | ||
| */ | ||
| importMapInjector: { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is defined in the types published to npm. Is it possible to reuse those types? https://app.unpkg.com/@single-spa/import-map-injector@2.0.2/files/types/import-map-injector.d.ts#L11 |
||
| initPromise: Promise<void>; | ||
| }; | ||
| /** | ||
| * Gets a set of options from the import-map-overrides package. | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,35 +10,35 @@ | |
| href="<%= openmrsFavicon %>" | ||
| > | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <meta name="importmap-type" content="systemjs-importmap"> | ||
| <meta name="importmap-type" use-injector> | ||
| <%= htmlWebpackPlugin.tags.headTags %> | ||
| <% if (openmrsImportmapDef) { %> | ||
| <script type="systemjs-importmap"><%= openmrsImportmapDef %></script> | ||
| <script type="injector-importmap"><%= openmrsImportmapDef %></script> | ||
| <% } else if (openmrsImportmapUrl) { %> | ||
| <link | ||
| rel="preload" | ||
| href="<%= openmrsImportmapUrl %>" | ||
| as="fetch" | ||
| crossorigin="anonymous" | ||
| > | ||
| <script type="systemjs-importmap" src="<%= openmrsImportmapUrl %>"></script> | ||
| <script type="injector-importmap" src="<%= openmrsImportmapUrl %>"></script> | ||
| <% } %> | ||
| <% if (openmrsCoreImportmap) { %> | ||
| <script type="systemjs-importmap"><%= openmrsCoreImportmap %></script> | ||
| <script type="injector-importmap"><%= openmrsCoreImportmap %></script> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why spaces added? For indentation because of ejs? Output html will have indentation bc of this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mostly for consistency. It matches the indentation of all the other sub-elements of |
||
| <% } %> | ||
| <% if (openmrsRoutesDef) { %> | ||
| <script type="openmrs-routes"><%= openmrsRoutesDef %></script> | ||
| <script type="openmrs-routes"><%= openmrsRoutesDef %></script> | ||
| <% } else if (openmrsRoutesUrl) { %> | ||
| <link | ||
| rel="preload" | ||
| href="<%= openmrsRoutesUrl %>" | ||
| as="fetch" | ||
| crossorigin="anonymous" | ||
| > | ||
| <script type="openmrs-routes" src="<%= openmrsRoutesUrl %>"></script> | ||
| <link | ||
| rel="preload" | ||
| href="<%= openmrsRoutesUrl %>" | ||
| as="fetch" | ||
| crossorigin="anonymous" | ||
| > | ||
| <script type="openmrs-routes" src="<%= openmrsRoutesUrl %>"></script> | ||
| <% } %> | ||
| <% if (openmrsCoreRoutes) { %> | ||
| <script type="openmrs-routes"><%= openmrsCoreRoutes %></script> | ||
| <script type="openmrs-routes"><%= openmrsCoreRoutes %></script> | ||
| <% } %> | ||
| </head> | ||
| <body> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we've migrated the existing apps, we should be able to replace this whole dynamic loading stuff with something like:
And once we get to shared dependencies on the import map, this will all go away completely.