admin管理员组文章数量:1313138
Sprocket is a Ruby library for managing JavaScript dependencies. It makes it possible to declare dependencies in specially formatted ments in the JavaScript files, and have all the required files concatenated server side. (Read more here: /)
Where I work, we have a real need for such a framework, but it has to be in the form of a Java library.
Does such a thing exist? What other solutions have you e up with to manage JavaScript dependencies?
Sprocket is a Ruby library for managing JavaScript dependencies. It makes it possible to declare dependencies in specially formatted ments in the JavaScript files, and have all the required files concatenated server side. (Read more here: http://getsprockets/)
Where I work, we have a real need for such a framework, but it has to be in the form of a Java library.
Does such a thing exist? What other solutions have you e up with to manage JavaScript dependencies?
Share Improve this question asked Mar 4, 2010 at 12:57 KaptajnKoldKaptajnKold 10.9k10 gold badges43 silver badges57 bronze badges6 Answers
Reset to default 3You may have a look at this webutilities as well.
You can also use juicer to merge javascript files although it's also written in ruby.
Another option that, I suppose, will suit you is using biner by Nicholas C. Zakas if you do not need all the features of juicer and sprockets. It is pretty simple, written in java (.jar) and the source can be found in author's repository. You can also fork the source in order to tune it according to your needs.
Such a feature exists in the Wicket framework. It is a ponent-oriented web framework for Java that is gaining momentum these days.
Wicket lets you define header resources in your ponents (eg, Javascript scripts, CSS files, etc.) and bines them at runtime, removing duplicates.
I know this was answered a long time ago but my vote is for JAWR!
You can run sprockets inside a java web application using jruby. It is not too difficult. You could disable sprockets in production and only use statically piled assets if you are worried about performance. It's also possible with Servlet-3.0 to pletely disable sprockets in production and have the same web.xml or you could do dodgy things with a proxy context listener and proxy servlet filter if you are concerned about having to load the jruby runtime and sprockets even when you are not using it.
I have an example here: https://github./benmmurphy/java_sprockets
Yes, it does exist and its even richer in functionality https://github./QubitProducts/miniMerge.
Ii is also very fast and very small (few kb)! All you need is java.
I use it in my all projects, it is not only for JS, I use it also with CSS and HTML.
One awesome thing is that you can specify file or directory as input and filter contents based on tagging!
本文标签: javascriptDoes something like Sprocket exist for JavaStack Overflow
版权声明:本文标题:javascript - Does something like Sprocket exist for Java - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741938928a2406026.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论