Join GitHub today
Clean up dev-server options #1175
* (BREAKING) Stops setting `host` / `public`, since they are only needed in a minority of use-cases (such as running inside a Docker container or having a proxy in front of webpack-dev-server), and the current implementation for them in `@neutrinojs/dev-server` is buggy. * (BREAKING) Stops supporting the `@neutrinojs/web` shorthand of setting `devServer.proxy` to a string, since it could only be used if the options it set were exactly what were required - which was often not the case given that proxy configuration is very project-specific. * Stops setting a `host` header on *responses* to the client, since it makes no sense (particularly it was set to the public host). It's possible that this was set thinking they would be set for *requests* to a proxy target, but that's not the case (and for that, `changeOrigin: true` would be more appropriate anyway). * Changes `output.publicPath` from `'./'` to `''` since the latter is equivalent (and is also the webpack default), however it correctly allows webpack-dev-server to fall back to `'/'` when needed: https://github.com/webpack/webpack-dev-server/blob/v3.1.9/lib/Server.js#L176 * Stops setting `devServer.publicPath` explicitly since it inherits from `output.publicPath` so should not normally need to be overridden: https://github.com/webpack/webpack-dev-server/blob/v3.1.9/bin/webpack-dev-server.js#L142-L152 * Stops setting `https: false`, since that's the default. Fixes #1169.
Note we may be changing this again in #1171, however I wanted to get the ~"no-op" cleanup out of the way first.