webpack/webpack-dev-server — pull request #46 by syranide (2014-08-19 20:56:17+00:00)
Title: Smarter query string for client entry, also works for script

My use-case is that I require HTTPS and have set-up an nginx proxy in a directory `/webpack-dev-server/` for webpack-dev-server. This allows me to use certificates and basically pretend that webpack-dev-server doesn't exist. However, `/socket.io/` is "hard-coded" and cannot be changed currently, this allows it to be replaced with any URL.

This PR significantly improves the query string and also enables it for the script tag.

Currently, the only supported syntax is:
`'webpack-dev-server/client?http://domain'`
... `/socket.io` is implicit.

This adds support for paths:
`'webpack-dev-server/client?https://domain/webpack-dev-server/socket.io'`
... `/socket.io` is no longer implicit when a path is present.

It also adds support for relative paths:
`'webpack-dev-server/client?/webpack-dev-server/socket.io'`
`'webpack-dev-server/client?socket.io'`
... is equivalent given that the script is loaded from `/webpack-dev-server/bundle.js`.

Also, as I mentioned, script tags support the same syntax:
``

Caution though, I haven't tested this extensively and I haven't tested the script tag at all (but I did test it manually in the code and it seemed fine) as I'm not sure how the `index.bundle.js` is created. The code is complicated by the fact that URLs are currently required (by webpack-dev-server) to not have a tailing `/` which is technically incorrect as they are directories and not files, which makes the resolving a bit finicky.