aurelia / new

The Aurelia 2 scaffolding repo used by our tools to setup new projects.
MIT License
38 stars 18 forks source link

Webpack 5 live reload not working #49

Closed ivanbacher closed 3 years ago

ivanbacher commented 3 years ago

Created a new app using npx makes aurelia and picked the template with routes. Live reload doesn't seem to be working. Reading the webpack 5 docs it should be turned on by default.

3cp commented 3 years ago

Somehow, webpack 5 is released quite a while, but webpack-dev-server for webpack 5 is still not for production.

3cp commented 3 years ago

The beta webpack-dev-server seems caused some issue on CI. I will investigate when I got more time.

3cp commented 3 years ago

dev-server v4 beta caused lot more problem. I will revert to v3 for now.

3cp commented 3 years ago

webpack-dev-server v3 supposes to work with webpack 5. (v3 added webpack5 support since v3.10.0).

This failed watch mode might be due to some new version of webpack/webpack-cli/webpack-dev-server.

3cp commented 3 years ago

Somehow with latest v3 dev-server, there is no more [WDS] websocket connection in browser, that's probably why live reload is not working. I have not find the combination of webpack/webpack-dev-server versions to bring it back to normal.

ivanbacher commented 3 years ago

Thanks for taking a look. Adding the following to webpack config seems to work:

target: 'web'
3cp commented 3 years ago

Awesome!

3cp commented 3 years ago

Webpack doc said target:web is the default :sweat: No idea how did they break this.

3cp commented 3 years ago

closed by #52