Stolz / Assets

An ultra-simple-to-use assets management library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pipeline only certain collections

nathanfirth opened this issue · comments

What I'm trying to do is have a collection of base JS & CSS that gets included via the autoload assets array. I want this "base" collection to get pipelined. Then as I manually add javascript via Asset::add() for specific pages, that should not get pipelined into the main file. It could get pipelined into a separate file specific files as long as it's independent of the main base collection. Is this possible?

commented

All assets of the same kind share the same pipeline so it's not possible to make them behave independently.

You have two options:

  • The quick and dirty is enable pipeline, add the assets you want to autoload, and after they get pipelined, disable pippeline, rename them and move them to your assets dir and use as normal.
  • The more elegant solution it to use multiple instances of the library. Check issue #37 for details.
commented

Please note last update has introduced the multitenancy feature of the library, which it may help you in that scenario.