Grails Asset-Pipeline system with 3rd party libs

前端 未结 5 2254
长情又很酷
长情又很酷 2021-02-07 04:59

Grails 2.4 is now using the Asset Pipeline for managing and processing static assets in Grails applications instead of the Resources system. Th

5条回答
  •  忘掉有多难
    2021-02-07 05:37

    You can create another folder like jsplugins near standard folders (javascripts, styles, images), then you can include js library in the necessary pages, if you wouldn't use this library on all the pages.

    Make something like this:

    
    

    NB: you can omit first level path under assets path, in this example it's jsplugins.

    The best way is to use manifest.js file, where you can include necessary files via require directive.

    You should use assests folder instead of web-app. During building war file all the files from assets will be copied to web-app folder.

    Useful video from Bobby Warner: http://www.youtube.com/watch?v=VHDBlGtAHB4

    Documentation: http://bertramdev.github.io/asset-pipeline/

提交回复
热议问题