0

I'm playing with this tutorial : https://spring.io/guides/tutorials/react-and-spring-data-rest/

It is very interesting, driving into spring boot, data, rest and react, but i 'm stuck with this issue playing with it : after editing the Javascript, the spring application must be restarted and the cache of the browser emptied.

The author suggests : "Want to see your JavaScript changes automatically? Run npm run-script watch to put webpack into watch mode. It will regenerate bundle.js as you edit the source." But if the js source is effectively automatically rebuilt, the js "running" in the spring app is not updated, nor the app restarted ...

It's seems that the solution should be to transforme the boot application project into a war project, in this way resources modified under src/main/webapp will be automatically updated in the embedded tomcat in eclipse ...

Someone has already adressed this problem ?

sssimon
  • 103
  • 1
  • 7

1 Answers1

0

I found the solution here, by https://stackoverflow.com/users/999466/eigil : Refreshing static content with Spring MVC and Boot

Starting the app with mvnw spring-boot:run, after configuration added in the pom.xml as in the thread.

I had to start the command npm run-script watch as suggested in the tutorial at the root of the project.

When editing a js file, the modification is directly visible on the browser after refresh, yeah !

sssimon
  • 103
  • 1
  • 7