samdark / yii2-cookbook

Yii 2.0 Community Cookbook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asset processing with Gulp

DenisAlliswell opened this issue · comments

Hello @samdark!

What about Asset processing with Gulp receipt?

Nowdays Gulp is popular task manager so it wouldn't be redundant to add this receipt as well as Grunt one)

Thanks in advance!

I'm not really familiar with Gulp. Yii-wise it's same as Grunt i.e. turning off asset manager.

Yes, It's same as Grunt. Completely. I'm using Gulp for Yii projects. I think such recipe will almost duplicate Gulp recipe.

Maybe better to merge them in one recipe: "Asset processing with frontend task runners" or something like this.

Btw one of the problem is Yii2 extensions. They are registering their own source files with help of assets. As result we have a lot of separated sources which decrease performance. Will be excellent to write a recipe about how to manage all of this: Yii extensions and Gulp/Grunt

I think two seaparate recipes make sense in this case. In case of extensions you have to specify all these asset files manually for each extension.

This is a problem. A lot of manual work (in comparison) and if extension structure is changed something might be broken. Might it be a proposal for Yii2? To solve such issue somehow

Is it possible not to publish but to move all source files inside a special dir? Automatically. In order not to find all of them manually. And then gulp/grunt compresses them in one file.

Moving files inside a special dir is publishing. Gulp is JS tool, it can't read PHP classes.

A special tool that generates map from asset bundles could be created though.

But it would have no idea which bundles to use and which not to use.

That would be too complicated.