Skip to content

What is the webpack:// protocol? #11058

@npetruzzelli

Description

@npetruzzelli

Per Webpack's issue template:

<!-- Bug reports and Feature requests must use other templates, or will be closed -->
<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->
<!-- Issues which contain questions or support requests will be closed. -->

I originally tried asking this question on StackOverflow, but with no luck. Since the question will likely be deleted, I will copy the contents below:

I downloaded and searched the documentation repository using my text editor for the string webpack://, and found it located in only two documents:

As far as I can tell, this is not an actual protocol, much less one a browser can understand.

Questions:

  1. What is the webpack: protocol intended to be used for?
  2. Where can I find documentation on it?
  3. (assuming it is used internally by webpack or webpack dev server) Why do I see it output in Source Maps or in some project boiler plates, when the browser has no way of understanding what it should do with the protocol?

Update 2018-05-25

I checked Webpack's source code in addition to their documentation repo, and this is what I found:

(Paths instead of links since I lack the reputation to post more than 8)

StackOverflow Comments

I mean that the structure of the source URL in a sourcemap is meaningless to tooling. ie, the protocol doesn't matter. – SLaks May 25 at 15:17

... The protocol shouldn't matter, but for some reason it does, especially when the final sourcemap includes this as a protocol. The browser has no way of understanding a webpack:// URL. It shows up in the links above and in Angular CLI ( github.com/angular/angular-cli/blob/1.7.x/packages/%40angular/… ) when you eject a configuration (I'm currently on 1.7.4, they recently made the jump from 1.x to 6.x, which temporarily removes "eject"). I'd like to know why the webpack and angular teams use it. – nick May 25 at 16:27


Since Angular CLI also uses/used the webpack:// protocol, is there anyone here who might be able to explain it to me?

Thanks and regards.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions