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
With library.type: module, import.meta.url shouldn't be replaced with static string #14809
Comments
I did came across this issue, as I was trying to use |
Yep, we should improve this |
Now we allow to disable |
So original issue resolved, just disable it for required files and it will work |
Thanks @alexander-akait this looks like it will work. I'll try it out as soon as it is released |
yep, this can be closed |
Bug report
What is the current behavior?
When bundling a library with
type: 'module'
, source references toimport.meta.url
are replaced with staticfile:///...
strings.As a result, operations on query parameters like the example from the MDN page on
import.meta
do not work.If the current behavior is a bug, please provide the steps to reproduce.
Observable at https://immers-space.github.io/immers-client/
scriptArgs
is always empty because theimport.meta.url
is replaced with the build-time filepathWebpack config (45 lines): https://github.com/immers-space/immers-client/blob/main/webpack.common.js
What is the expected behavior?
import.meta.url
appears unmodified in the output and I am able to retrieve query parameters from it at runtimeOther relevant information:
webpack version: 5.64.2
Node.js version: v16.13.0
Operating System: Ubuntu 21.10
Additional tools: none
The text was updated successfully, but these errors were encountered: