-
Notifications
You must be signed in to change notification settings - Fork 1
feat(appconfig): Add base path so module preloading works #43
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
Conversation
Signed-off-by: Ferdinand Thiessen <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #43 +/- ##
==========================================
- Coverage 80.26% 79.70% -0.56%
==========================================
Files 8 8
Lines 537 547 +10
Branches 32 32
==========================================
+ Hits 431 436 +5
- Misses 74 79 +5
Partials 32 32
|
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.
Makes sense, replacement for __webpack_public_path__
.
So we need to use the runtime feature (currently hidden behind a the experimental flag).
I guess it is safe as this experimental feature is already in use by many things, including Nuxt.
I get this error now with the migration to
|
The reason was a a file in the style section of a vue file like so |
For apps the config will generate a vite app config, so vite will try to preload all modules imported directly by the entry point.
To do so we have to configure the base path where to import the modules from (this is different from normal import, as module preloading works by adding the modules with their source URL to the document, meaning for normal imports the base url is not required (browsers support the relative imports), but for module preloading it is).
We can not set one base url, as we do not know it (we do not know the webroot of an app on build time).
So we need to use the runtime feature (currently hidden behind a the experimental flag).