什么是资产管道插件和资源插件?它们之间有什么不同?

What is asset-pipeline plugin and resources plugin? What is the different between them?

什么是资产管道插件和资源插件?

它们有什么区别?

优缺点是什么?

是否必须使用不同的 js 和 css 框架?

简单地说,asset-pipeline 插件取代了 resources 插件,应该用于管理您的资产(例如 js 和 css)。

资源插件先于资产管道插件存在。它用于简化和标准化 Grails 应用程序中资产的使用。后来被asset-pipeline插件取代。

asset-pipeline 插件是一个功能强大、功能丰富且可扩展的插件,用于管理您的资产(主要是 js,css)。它还具有其他几个补充插件,允许对资产进行预处理(例如 LESS)。

虽然资产管道插件的使用不是必需的,但强烈推荐并且是更高版本的 Grails 的默认设置.

什么是资产管道插件和资源插件?

Both of this are grails plug-in which enables programmer to use web related resources or assets such as style sheets, js etc in an easy and efficient way .

This plug-in reduces developers overhead in dealing with dependency, order of loading and many other issues and also make efficient use of resources or assets by compressing or removing duplicates and decreasing the loading time

它们有什么区别?

There are many difference between them like how they load resources, how they keep resources, how they find duplicates, file system organization etc.

优缺点是什么?

Advantages of asset-pipeline over standard grails resources plug-in:

File dependencies are in the top of your assets. (No Resources.groovy)
Assets in plugins become level with your app.
On the fly processing in Development mode (No more waiting for reloads)
Coffeescript, LESS, and others become first class citizens ( debuggable )
Require entire folder trees with one line
Better minification (UglifyJs) , and compiling before the WAR is built
Faster application startup time
Easy extensibility

是否必须使用不同的 js 和 css 框架?

No, you can directly use resources or assets, but it would be messy and inefficient.

参考:

http://grails-plugins.github.io/grails-resources/guide/

https://github.com/efficiently/larasset/wiki/Asset-pipeline

https://github.com/bertramdev/grails-asset-pipeline/wiki/Why-asset-pipeline-over-grails-resources-plugin