jasonlewis / basset

A better asset management package for Laravel.
http://jasonlewis.me/code/basset
240 stars 76 forks source link

Generating when css and js in same folder #207

Open mzf opened 11 years ago

mzf commented 11 years ago

I use this code

$collection->directory('assets', function($collection)
            {
                $collection->directory('admin/plugins', function($collection)
                    {
                        $collection->stylesheet('bootstrap/css/bootstrap.min.css');
                        $collection->stylesheet('bootstrap/css/bootstrap-responsive.min.css');
                        $collection->stylesheet('font-awesome/css/font-awesome.min.css');                     
                    })->apply('UriRewriteFilter')->apply('CssMin');

                $collection->directory('admin/plugins', function($collection)
                    {
                        $collection->javascript('jquery-1.10.1.min.js');
                        $collection->javascript('jquery-migrate-1.2.1.min.js');
                        $collection->javascript('jquery-ui/jquery-ui-1.10.1.custom.min.js');                        
                    })->apply('JsMin');
            });

After running php artisan basset:build -f [admin_test]←[Stylesheets build was not require [admin_test]←[Javascripts successfully built. i have only js files in compiled directory. No one css. Then when i do

 $collection->directory('assets', function($collection)
            {
                $collection->directory('admin/plugins', function($collection)
                    {
                        $collection->stylesheet('bootstrap/css/bootstrap.min.css');
                        $collection->stylesheet('bootstrap/css/bootstrap-responsive.min.css');
                        $collection->stylesheet('font-awesome/css/font-awesome.min.css');                     
                    })->apply('UriRewriteFilter')->apply('CssMin');

                $collection->directory('admin', function($collection)
                    {
                        $collection->javascript('plugins/jquery-1.10.1.min.js');
                        $collection->javascript('plugins/jquery-migrate-1.2.1.min.js');
                        $collection->javascript('plugins/jquery-ui/jquery-ui-1.10.1.custom.min.js');                        
                    })->apply('JsMin');
            });        

JS and CSS both successfully created and ←[admin_test]←[Stylesheets successfully built. ←[admin_test]←[Javascripts successfully built.

When using js plugins, files of different types often are in one folder and it is necessary to use way change for normal generation. I think such behavior is wrong

yunidbauza commented 11 years ago

I'm having exactly the same issue.