CodeSleeve / asset-pipeline

This Laravel 4 package provides a very simple and easy to use asset pipeline. It was heavily inspired by the Rails asset pipeline. We make use of the wonderful Assetic package to help with pre-compliation!
http://www.codesleeve.com
MIT License
489 stars 53 forks source link

Best Practice / Example for "thave a separate manifest file for each section" #226

Open shamelesshacker opened 9 years ago

shamelesshacker commented 9 years ago

This paragraph from the READ.me alludes to precisely the issue.

If you find yourself having issues with conditionally including assets your best bet may be to break apart your manifest files into sections that make sense for your application. For example, if your application is silo'ed into admin section and user section then it probably makes sense to have a separate manifest file for each section.

Specifically, I need guidance on the best way to isolate both the "admin" and "front end" sections of my site. If anyone has solved this in an elegant way, the advice would be appreciated.

kticka commented 9 years ago

Well, you can have two directories in your assets folder. For example 'frontend' and 'backend'. Each of them should have different manifest file, which you can include by javascript_include_tag(). For example javascript_include_tag('backend/manifest') or javascript_include_tag('frontend/manifest'). I my app I have organized assets not exact, but in quite similar way.