runtime imports #66619
stephen-dahl
started this conversation in
Ideas
runtime imports
#66619
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
My company has multiple next frontends for different pages of our site. We put common code like the main nav and reusable components into a shared library. Currently we import this library as an npm module. This works but if we change something on the menu we then have to go through all our frontend projects and update the library version. I would like to deploy the shared library bundle to a cdn and load it at runtime so that it can be updated independently of all the micro-services that use it.
experimental urlImports allow us to import at build time. this helps but still requires me to rebuild all my micro services to see the updates.
I tried setting webpack.externalsPresets = { web: true } to not compile in any import that starts with https:// but received error
Proposal
Rename urlImports to buildTimeImports. Add new runTimeImports also taking an array of url prefixes. These prefixes would be imported at runtime.
Beta Was this translation helpful? Give feedback.
All reactions