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
What is the current behavior?
When utilizing multiple entry points, and specifying a custom library name which includes the [name] placeholder, the source-map resource path is excluding the replaced [name] value with an empty string.
This is causing issues where sources will not be presented properly or may conflict if generated with the same output.library pattern.
Configure your webpack config to have multiple named entry-points.
Specify output.library to include the [name] placeholder. E.g: library-[name]
Ensure devtool: 'source-map' exists in your webpack config object. (This may also exist with other devtools but haven't been tested)
Run webpack build and inspect source map files. You will notice the sources will include values like: webpack://library-/...
What is the expected behavior?
The source map sources should include the correct namespace with the [name] value present. E.g: webpack://library-entry-a/... and webpack://library-entry-b/...
Other relevant information:
webpack version: 5.91.0
Node.js version: 20.11.1
Operating System: Windows 11
Additional tools:
The text was updated successfully, but these errors were encountered:
bwhite94
changed the title
Using [name] within output.library, the correct value isn't utilized in the source map namespace
Using [name] within output.library, the correct value isn't utilized in the source map namespace
Mar 25, 2024
@bwhite94 where is the webpack.config.js file i have got the issue and i think that i have a solution for it but i was not able to find the file in the repo can you help me out.
@bwhite94 where is the webpack.config.js file i have got the issue and i think that i have a solution for it but i was not able to find the file in the repo can you help me out.
It's in the minimal reproduction repo, but more specifically here.
I know of workarounds like generating separate webpack config objects for each entry-point that needs a different library name, but that defeats the purpose of using things like the [name] placeholder and adds extra overhead that could potentially break your webpack configuration if you're not careful.
Bug report
What is the current behavior?
When utilizing multiple entry points, and specifying a custom library name which includes the
[name]
placeholder, the source-map resource path is excluding the replaced[name]
value with an empty string.This is causing issues where sources will not be presented properly or may conflict if generated with the same
output.library
pattern.If the current behavior is a bug, please provide the steps to reproduce.
Minimal reproduction repository: https://github.com/bwhite94/webpack-source-map-issue
output.library
to include the[name]
placeholder. E.g:library-[name]
devtool: 'source-map'
exists in your webpack config object. (This may also exist with other devtools but haven't been tested)webpack://library-/...
What is the expected behavior?
The source map sources should include the correct namespace with the
[name]
value present. E.g:webpack://library-entry-a/...
andwebpack://library-entry-b/...
Other relevant information:
webpack version: 5.91.0
Node.js version: 20.11.1
Operating System: Windows 11
Additional tools:
The text was updated successfully, but these errors were encountered: