spring-attic / tut-react-and-spring-data-rest

React.js and Spring Data REST :: A tutorial based on the 5-part blog series by Greg Turnquist
https://spring.io/guides/tutorials/react-and-spring-data-rest
882 stars 1.58k forks source link

Live reloading not working #36

Closed javier-artiles closed 7 years ago

javier-artiles commented 7 years ago

After running npm run-script watch, changes in app.js are not reflected in the browser after reloading. It seems webpack.config.js is not pointing at the correct output directory.

It worked after this change:

     output: {
-        path: __dirname,
-        filename: './src/main/resources/static/built/bundle.js'
+        path: './target/classes/static/built/',
+        filename: 'bundle.js'
     },
gregturn commented 7 years ago

You actually have to restart the app to pick up JS only changes.

Writing to src/main/resources/static is to ensure that Spring Boot plugin properly picks things up for the uber JAR.

javier-artiles commented 7 years ago

@gregturn I see. Is there any way to have live reloading while editing the app.js file ?

gregturn commented 7 years ago

Read the DevTools part of Boot's ref docs. You can adjust the trigger.

javier-artiles commented 7 years ago

Thank you @gregturn , I got it working now with DevTools.

gregturn commented 7 years ago

👍

collier commented 6 years ago

@javier-artiles, any chance you should share how you configured DevTools to autoreload on JS changes? I am working through a similar issue myself.