Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

Generate Assetic packages only when content for scripts and/or styles isn't empty #60

Closed daFish closed 10 years ago

daFish commented 10 years ago

This PR fixes #58.

Description

When the bower.json of a component doesn't specify a main-directive, the command (and therefor the bundle) cannot find the correct files for creating the Assetic packages to be used in the template (e.g. @jquery_js). Using these definitions results in empty assets delivered by Assetic.

Solution

This PR solves this problem by checking if the packages to created have content. If not, the creation is stopped for a particular package. The command sp:bower:list now only print out packages with found files. All other assets need to be included manually.

Be social: When you include a package without a correct defined main-directive, please be social and create a PR in the respective project to include it. :+1: This way the bundle and bower will be even easier to use.

Todo

The following things still need to do:

daFish commented 10 years ago

Ok, I've came up with something that might work. Any thoughts, @Spea?

daFish commented 10 years ago

The failing Travis builds for dev-master are caused by the missing dependency for doctrine/cache. I can open up an PR if needed to add this dependency explicitly.

Spea commented 10 years ago

:+1: Big thx :)

daFish commented 10 years ago

You are very welcome. :)