-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Add option to SourceMapDevToolPlugin to exclude webpack:// protocol #12583
Comments
For maintainers only:
|
Because you have multiple source maps on the page and it creates collisions between them.
PR welcome in docs site. A lot of time was spent to design this and to make it work, do not think that some things are made to interfere. You have If you real need something not standard you can write own plugin to do it. But I don't recommend to do it. |
Also |
I'm sorry but I'm not following. Could you please help me understand?
Do you mean that there can be a collision between two different
I don't doubt that there was a lot of time put into the design but it's not clear to me how to use it. Someone must have added the
The spec says:
|
On page you can have source maps from other files, for example from CDN or from other files, so we need to use prefix to avoid collisions
But |
I do not believe that this is true, you do not need a prefix to avoid collisions.
Uniqueness of source files is exactly the same problem as the uniqueness of any other resource that is loaded on the page. We already have everything we need to disambiguate them without needing a new protocol. In fact there is no ambiguity in the first place. Consider we have a site on Are you able to provide a concrete example of where not having |
Why? We have a lot of issues about this, just use search... |
If there are 2 source maps
Can you please give me a clue what to search for or provide a link to the search results? I originally said:
I've already said that I don't know what it is there and I'm trying to understand why it is. I'm sensing a lot of hostility on this issue. |
Simple case, you have HTML:
Now you use the same But with You can partial look at #5767. There are more complex cases. If you really want, I can describe them. |
Thank you for the explanation. I agree with you that the scenario that you describe is a case where there is a conflict, however if you look at the description in #5767, it is a conflict with a file that does have the If you look at the solution that issue (easiest way is to look at the diff for the docs https://github.com/webpack/webpack.js.org/pull/1653/files) it is to add a unique namespace prefix. This is the same as what I described in the workaround in my very first post with This shows that the solution to conflicts is to make the paths unique by adding a unique prefix and not by adding the I have to remove the |
I think you want to this #3603, not only for Node.js (i.e. |
Feature request
What is the expected behavior?
When using
devtool: 'nosources-source-map'
I expect all entries in thesources
array of the source map to be relative paths and not contain thewebpack://
protocol prefix.Personally I would rather there never be a
webpack://
protocol prefix but that could be because I'm not aware of the rationale for having it in the first place.As a last resort I would at least like the workaround to be documented. Currently the https://webpack.js.org/configuration/devtool/ docs just says:
There is no mention of what further config options are needed. It should also be added as an example to https://webpack.js.org/plugins/source-map-dev-tool-plugin/.
What is motivation or use case for adding/changing the behavior?
I want to generate a source map file like:
I can then very easily deploy this to dev, test and prod and maintain full source mappings for error messages. In dev and test I can also deploy the
src
folder and have the sources available. Then in prod I don't deploy thesrc
folder.How should this be implemented in your opinion?
There is a basic workaround:
However this doesn't take into account what the public path would be or the
sourcePath
.The full workaround looks something like:
I don't get what the
namespace
is. I also don't get why there is a fallback template.One solution would be to add an option:
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: