AssetManager icon indicating copy to clipboard operation
AssetManager copied to clipboard

Using collections in development mode

Open dronchik opened this issue 10 years ago • 4 comments

I want to combine & minify my assets only in production mode, but in development mode I don't need todo this because it make debugging more complicated. How can I do this?

To allow minifications only in production mode I can remove filters from global.php and add to local.php in production environment and it will work great.

How can I do the same trick with collection resolvers?

Thanks!

dronchik avatar Apr 13 '15 15:04 dronchik

So if I understand this correctly... You want to load all assets individually for development, and combine them in a collection for production?

If so, that's not really possible right now. You can skip the minify filter using local configs.

We could create a ViewHelper that adds the assets conditionally based on a config. I'd accept a PR for that.

RWOverdijk avatar Apr 14 '15 09:04 RWOverdijk

Yes, I want to load all assets individually for development, and combine them in a collection for production. How this ViewHelper will work?

dronchik avatar Apr 14 '15 10:04 dronchik

@dronchik The view helper would basically extend the default headScript helper. You'd be able to configure it (local config) and have it add all files in a collection individually. I'm not sure how this would work internally.

RWOverdijk avatar Apr 14 '15 11:04 RWOverdijk

Sounds good:)

dronchik avatar Apr 14 '15 11:04 dronchik