简体   繁体   English

春季启动和react.js

[英]Spring boot and react.js

I have a simple spring boot project which uses the frontend-maven-plugin for development of react js files. 我有一个简单的spring boot项目,它使用frontend-maven-plugin开发react js文件。 It also includes webpack maven sure plugin execution. 它还包括webpack maven sure插件的执行。 I can see that when I make changes to the app.js file that I have it correctly regenerates the bundle.js under static/built/bundles.js. 我可以看到,当我对app.js文件进行更改时,可以正确地重新生成static / built / bundles.js下的bundle.js。 The server is meant to be listening on the static folder, as I am using liveReload, and any change to .css or html gets updated when i refresh the page. 由于我正在使用liveReload,因此服务器打算在静态文件夹上侦听,并且在刷新页面时对.css或html的任何更改都会更新。 However a ctrl + F5 doesnt update the javascript changes that are visible in bundle.js. 但是,Ctrl + F5不会更新bundle.js中可见的javascript更改。

My app is basically the security app here with some changes -> https://spring.io/guides/tutorials/react-and-spring-data-rest/ 我的应用基本上是这里的安全应用,只是做了一些更改-> https://spring.io/guides/tutorials/react-and-spring-data-rest/

What do I need to do to make sure it picks up the js changes without restarting the server? 我需要做些什么来确保它无需重新启动服务器就能获取js更改?

I only have 4 gigs on my laptop, I can see that there is enough memory available, but the building is just going to 99% in eclipse and not finishing. 我的笔记本电脑上只有4个演出,可以看到有足够的可用内存,但是建筑物的日食将达到99%且未完成。 If i stop the listener for changes ie stop from command line npm(npm run-script watch )or webpacK the build finishes in eclipse. 如果我停止侦听器进行更改,即从命令行npm(npm run-script watch)或webpacK停止,构建将在Eclipse中完成。 IS there contention here/locking or is my laptop just not powerful enough? 这里有争用/锁定吗?还是我的笔记本电脑功能不够强大?

This was a locking issue, webpack and node.js were running separately as processes, which i checked in Task Manager. 这是一个锁定问题,我在任务管理器中检查了webpack和node.js作为进程分别运行。 Once i removed the pom entry and stopped the Node.js processes running the issue was fixed. 一旦我删除了pom条目并停止了运行该问题的Node.js进程,就解决了该问题。 Strange that an example on the internet doesn't mention this. 奇怪的是,互联网上的示例并未提及这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM