Open TobbenTM opened 5 years ago
Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!
@LinusBorg Seems like @vue-bot didn't recognize the issue template, do I need to create a new issue, or can you open this one? :)
What problem does this feature solve?
Currently it is not possible to run the vue-cli serve behind a SSL proxy, since the cli hardcodes the HMR endpoint:
https://github.com/vuejs/vue-cli/blob/e48a9569a3a70855cbec38449195f2819bb633fb/packages/%40vue/cli-service/lib/commands/serve.js#L102-L115
Ideally, the HMR requests would also be routed through the proxy, eliminating the need for any additional configuration of vue-cli (adding SSL certificates, etc).
As per the webpack documentation (https://webpack.js.org/configuration/dev-server/#devserverpublic), by default the client will guess the HMR endpoint based in
window.location
, which would solve this issue. However, there is no way to avoid the above mentioned hardcoding unless we're running the cli in a container, which is not really a solution.A common use-case for this is how ASP.Net now does SPA integration; they proxy the SPA content to the actual framework dev servers (directly to create-react-app, etc). A Vue.js implementation of this has been made (https://github.com/EEParker/aspnetcore-vueclimiddleware), but it cannot alter the HMR endpoint without also modifying the dev server endpoint, which results in already occupied ports. The closest solution today is to edit the vue configuration to match each devs environment with something like:
What does the proposed API look like?
Update vue.config.js with additional option:
Would be nice if a command line parameter would also be available, or environment variables, so tools like the above mentioned "aspnetcore-vueclimiddleware" can set this option without modifying configuration.