Spea / SpBowerBundle

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

bootstrap css not being installed #130

Closed jhonatanTeixeira closed 8 years ago

jhonatanTeixeira commented 9 years ago

i got the following bower.json inside src/AppBundle/Resources/config/bower { "name": "crm-app-bundle", "dependencies": { "bootstrap": "~3.3.5", "angular": "~1.4.4" } }

and wen i try to use {% stylesheets "@bootstrap_css" %}

    {% endstylesheets %}

on my base twig it says resource bootstrap_css cannot be found

wen i run assetc:dump i get this: 05:27:25 [file+] C:\xampp\htdocs\crm\app/../web/assetic/bootstrap_js.js 05:27:25 [file+] C:\xampp\htdocs\crm\app/../web/assetic/bootstrap_js_bootstrap_1.js 05:27:25 [file+] C:\xampp\htdocs\crm\app/../web/assetic/angular_js.js 05:27:25 [file+] C:\xampp\htdocs\crm\app/../web/assetic/angular_js_angular_1.js

only bootstrap js is being dumped.

i even tryed to use lessphp, because i tought it was a less compiling problem, but still get the same error.

im on symfony 2.7 runing on windows 7 and php 5.6 nodejs and bower latest versions

what am i doing wrong?

fgibaux commented 9 years ago

I've the same problem here. with "bootstrap": "3.3.5" there is no @bootstrap_css in sp:bower:list ouptut ! but with "bootstrap": "3.3.4" and previous versions (I only tested some) there is a @bootstrap_css

tehplague commented 9 years ago

Confirmed on master branch

Spea commented 8 years ago

This is not an issue with this bundle, but an issue with the bower.json in bootstrap. I use the main section of the bower.json to determine which css-file i have to use for a certain bower package. If there is no css-file defined, I'm not able to register it in the assetic component. This commit in bootstrap made the change

tehplague commented 8 years ago

Yes, but they made the change due to a misinterpretation of bower's spec which has been fixed. The main section was not designed for this purpose.

See http://blog.getbootstrap.com/2015/06/15/bootstrap-3-3-5-released/#wiredep-and-bower and https://github.com/bower/spec/pull/43

Spea commented 8 years ago

Well if that is the case the only solution would be, to define a new assetic @bootstrap_less, but then you need less/sass (or whatever the main type is) in your project which might be overkill. I see no other way to determine the main css-file for a bower package if the file is not declared in the main-section.

If bower does not offer another way, this bundle might become useless ...

tehplague commented 8 years ago

If bower does not offer another way, this bundle might become useless ...

Well, that would be the worst case. Integrating less or sass into the asset pipeline might be an option but that would mean a major rewrite that alters the whole purpose of this bundle. I must admit that I am completely unsure about this. :(