jasonlewis / basset

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

Assets in browser not updating #192

Closed maknz closed 11 years ago

maknz commented 11 years ago

Hi,

Chances are this is a problem on my end, but I can't seem to find anyone with the same issue.

I've been using Basset for a while now and it's been great, but I recently wanted to include CKeditor to my application collection. Here is the collection after I did so:

Basset::collection('application', function($collection)
{
    $collection->stylesheet('stylesheets/jquery-ui.css');

    $collection->javascript('javascripts/jquery-2.0.3.min.js');
    $collection->javascript('javascripts/jquery-ui.js');

    $collection->javascript('javascripts/speakingurl.min.js');
    $collection->javascript('javascripts/slug.js');
    $collection->javascript('javascripts/tag-it.min.js');
    $collection->javascript('javascripts/tag.js');

    $collection->javascript('javascripts/ckeditor/ckeditor.js')->raw();
});

Go to refresh -- it doesn't show up. It's definitely in that path since I can paste it verbatim into the browser and get the .js file. The raw() is since it'll be requiring its own assets relative to itself.

So I comment out all the $collection-> calls in the ::collection closure above, and refresh the browser, and nothing changes.

I then do a php artisan basset --delete-manifest followed by a php artisan basset:build. Refresh, nothing's changed. The old assets, now commented out from the collection, got rebuilt and added freshly to builds/application.

Is there some kind of aggressive caching in play? Or am I missing something else?

maknz commented 11 years ago

Ok, as expected, it was my problem.

The default config for the application collection was in play, so it was autoloading first-level nested assets from assets/javascripts and assets/stylesheets. I thought my Basset::collection definition was at play, but it wasn't, hence why no changes seemed to do anything. Heh. Additionally, I'm not including assets/ on the front of the paths for the collection as that's only a given for the default application collection (if I understand correctly).