samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.45k stars 296 forks source link

Asset processing with Gulp #105

Open DenisAlliswell opened 8 years ago

DenisAlliswell commented 8 years ago

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!

samdark commented 8 years ago

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

DenisAlliswell commented 8 years ago

Ok)

mrsurname commented 8 years ago

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

samdark commented 8 years ago

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.

mrsurname commented 8 years ago

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

samdark commented 8 years ago

How?

mrsurname commented 8 years ago

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.

samdark commented 8 years ago

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

samdark commented 8 years ago

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

samdark commented 8 years ago

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

samdark commented 8 years ago

That would be too complicated.