动态LESS编译器的java web应用程序? [英] On the fly LESS compiler for java web app?

查看:392
本文介绍了动态LESS编译器的java web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来编译CSS LESS文件在服务器端在开发期间按需。例如,如果浏览器向/assets/css/foo.css发出请求,我想服务器注意到有一个/assets/css/foo.less文件,然后让这个文件被编译,并返回结果css。我猜想一定有一个LESS servlet在某个地方可以做到这一点?



我使用Spring MVC应用程序运行tomcat 7



如何配置Java Web App

我认为你要找的是一个服务过滤器。我 不知道现成的一个执行LESS编译,并已开始使用 lesscss -java ,但现在我可以看到有一个更大的项目,名为 Java Web资源优化 - wro4j 与服务器端LESS支持。


I am looking for a way to compile CSS LESS files on the server side on demand during development. For example if the browser makes a request to /assets/css/foo.css I want the server to notice that there is an /assets/css/foo.less file and then to have this file complied and the resulting css returned. I am guessing there must be a LESS servlet somewhere that can do this?

I am running tomcat 7 with Spring MVC application

How do I configure a Java Web App to do on the fly LESS compilation?

解决方案

I think what you are looking for is a Servlet Filter. I was not aware of an off the shelf one that does LESS compiling and would have started to make one using lesscss-java, but now I can see there is a larger project called Web Resource Optimizer for Java - wro4j with server side LESS support.

这篇关于动态LESS编译器的java web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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