Eclipse在运行时不会重新加载已编译的CSS [英] Eclipse does not reload compiled css while running

查看:493
本文介绍了Eclipse在运行时不会重新加载已编译的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TLDR;

Eclipse似乎无法检测到已编译的CSS文件中的更改,因此不会在正在运行的服务器上重新加载它们.

问题

每次更新较少的文件时,我都可以使用 wro4j 从较少的文件成功生成css文件. /p>

我已关注 wro4j eclipse集成,如果来源,它将重新生成输出较少的文件更改,但这些更改无法在浏览器中重新加载.

但是,如果在生成后手动修改已编译的CSS,则更改会通过eclipse/spring-boot成功重新加载. 因此,当前我对较少的文件进行更改后,会生成css文件,但不会被正在运行的服务器接收.我必须打开已编译的文件,键入一个空格,然后退格并保存它,然后才能重新加载它.

关于如何解决此问题的任何想法?

Eclipse将重新加载所有更改,除非文件是自动生成的. 例如.如果我修改了我的html文件之一,则会立即重新加载它们. 但是,如果我修改了一个较少的文件,而该文件又修改了css文件..即使重启后,它也保持不变..

我认为可能也是因为现在有缓存,但是我尝试了这些设置,但仍然无法正常工作

spring.thymeleaf.cache=false
spring.resources.cache-period= 5
spring.resources.chain.cache=false

解决方案

尝试使用本机钩子或轮询将 Refresh设置为true.

窗口->首选项->常规->工作区->检查刷新使用 本机挂钩或轮询

希望有帮助

TLDR;

Eclipse does not seem to detect changes in compiled css file and does not reload them on a running server.

Problem

I can successfully generate css files from less files using wro4j everytime i update a less file.

I have followed this tutorial from the official spring boot website itself.

Text from the tutorial

The wro4j-maven-plugin has some Eclipse integration features and you can install it from the Eclipse Marketplace (try it later if this is your first time - it’s not needed to complete the application). If you do that then Eclipse will watch the source files and re-generate the outputs if they change. If you run in debug mode then changes are immediately re-loadable in a browser.

I have used the wro4j eclipse integration which re generates the output if the source less file changes, but these changes are not re loadable in the browser.

However, If I manually modify the compiled css after generation, the change is successfully reloaded by eclipse/spring-boot. So currently after i make changes to the less files, css files are generated but is not picked up by the running server. I have to open the compiled file, type a space and do a backspace and save it, only then it's reloaded.

Any ideas on how to solve this problem?

EDIT: Eclipse is reloading all the changes except if the file has been auto generated. For eg. If i modify one of my html files it reloads them right away. But if i modify a less file, which in turn modified the css file.. this stays the same..even after restart.

I thought it could have also been because of caching now but i tried these settings and it still doesn't work

spring.thymeleaf.cache=false
spring.resources.cache-period= 5
spring.resources.chain.cache=false

解决方案

Try to set Refresh using native hooks or polling to true.

window-> preferences-> general -> workspace -> Check Refresh using native hooks or polling

Hope that helps

这篇关于Eclipse在运行时不会重新加载已编译的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆