You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library entry code sports the excellent idea of assigning Webpack's publicPath at runtime to allow modules to be used cross domain / webroot. Per the comments in resolveLibConfig.js:
// use dynamic publicPath so this can be deployed anywhere
// the actual path will be determined at runtime by checking
// document.currentScript.src.
It is expected that the dynamic publicPath should be resolved early enough to apply to all resource loading.
What is actually happening?
That functionality, implemented in entry-lib.js, unfortunately does not run early enough to affect resources that are loaded as part of the initial code chunk. It seems to currently only work if you call import() later, after initial load.
Context: In my real-world project this bug is preventing me from loading CSS in my library and having webpack properly resolve the hostname for the bundled assets (fonts, images, etc).
The text was updated successfully, but these errors were encountered:
doublemarked
changed the title
Dynamic hostname publicPath feature (from --target lib config) is broken for non-lazy imports
Dynamic hostname publicPath feature (from --target lib config) is broken for early resolved resources
May 9, 2018
Version
3.0.0-beta.9
Reproduction link
https://github.com/doublemarked/vue-libconf-issues
Steps to reproduce
git clone https://github.com/doublemarked/vue-libconf-issues.git
npm install && npm run build && npm run demo
http://localhost:8000
What is expected?
The library entry code sports the excellent idea of assigning Webpack's
publicPath
at runtime to allow modules to be used cross domain / webroot. Per the comments in resolveLibConfig.js:It is expected that the dynamic
publicPath
should be resolved early enough to apply to all resource loading.What is actually happening?
That functionality, implemented in
entry-lib.js
, unfortunately does not run early enough to affect resources that are loaded as part of the initial code chunk. It seems to currently only work if you callimport()
later, after initial load.Context: In my real-world project this bug is preventing me from loading CSS in my library and having webpack properly resolve the hostname for the bundled assets (fonts, images, etc).
The text was updated successfully, but these errors were encountered: