-
-
Notifications
You must be signed in to change notification settings - Fork 133
Description
I'm submitting a feature request
Current behavior:
When running a CLI generated project based on webpack, the path used by the webpack dev server client to make it's websocket requests is unnecessarily specified to be the same as the host:port specified in the aurelia.json and run.ts files. (port is specified in aurelia.json and host in run.ts)
Specifying the host:port is not required as it is derived from window.location and output.publicPath in the webpack.config.
This does not cause a problem in a simple app, but becomes apparent when you start to do something like run behind a reverse proxy during development, like in the case of using Aurelia with .NET Core using the new SpaProxy. Refer to this issue that i logged and closed: aspnet/JavaScriptServices#1743
This issue did not occur using Angular, because the webpack config behind the Angular CLI did not specify a specific host:port for the dev server client.
The fix is to change the following in 'aurelia_project/tasks/run.ts'
config.entry.app.unshift(`webpack-dev-server/client?http://${opts.host}:${opts.port}/`, 'webpack/hot/dev-server');
to this:
config.entry.app.unshift(`webpack-dev-server/client`, 'webpack/hot/dev-server');
-
What is the expected behavior?
I should have been able to (or was hoping that i could) transplant the Angular app inside adotnet new angulargenerated project with an Aurelia app with no changes required in the Aurelia app. -
What is the motivation / use case for changing the behavior?
Now that Microsoft have retired their Aurelia SPA template which is no longer available in dotnet v2.1 which uses the new SpaProxy based templates, making it easier to switch it over to Aurelia may help stem the resulting inevitable decline in Aurelia adoption rates for .NET users.