Question about Spree assets:precompile js & css for vendor and lib dir

362 views
Skip to first unread message

Tom

unread,
Jan 17, 2012, 5:48:46 PM1/17/12
to Spree
I'm currently using spree 0.70.3 and Rails 3.1.3, and got questions
about assets precompiles process for vendor dir.

I have specific js and css files in:
../vendor/assets/javascripts/jquery.fileupload-ui.js
../vendor/assets/stylesheets/jquery.fileupload-ui.css

After reading this doc,
http://guides.spreecommerce.com/asset_customization.html

it says "Javascript & stylesheet files in lib/assets or vendor/assets
sub-directories should be manually
required in the appropriate all.(js|css) manifests."

I follow the direction and add it here:
=======> xyz-app/app/assets/javascripts/admin/all.js
//= require admin/spree_core
//= require admin/spree_auth
//= require admin/spree_api
//= require admin/spree_dash
//= require admin/spree_promo

//= require_tree .

//= require jquery.fileupload-ui

=======> xyz-app/app/assets/javascripts/admin/all.css
/*
*= require admin/spree_core
*= require admin/spree_auth
*= require admin/spree_api
*= require admin/spree_promo
*= require admin/spree_dash
*= require_self
*= require_tree .

*= require jquery.fileupload-ui
*/
=====================

a) First i clear the ../public/assets & tmp/cache/...
rake assets:clean:all RAILS_ENV=development RAILS_GROUPS=assets

b) Then i ran this cmd below and i assume it will populated to my ../
public/assets/..
bundle exec rake assets:precompile RAILS_ENV=development
RAILS_ASSETS_NONDIGEST=true

Question: Why the jquery.fileupload-ui.css and jquery.fileupload-
ui.js not being added to
my xyz-app/public/assets/.... at all?

Thanks for your help :- )

- Thomas

Brian Quinn

unread,
Jan 18, 2012, 6:18:52 AM1/18/12
to spree...@googlegroups.com
Hi Thomas,
By adding the require into the all.js / all.css this will copy the contents of jqueru.fileupload-ui  into the compiled all.js/css file. 

In order to have that file precompiled standalone, you need to add a pattern to match as follows (in application.rb)

config.assets.precompile += ['jquery.fileupload-ui.*']

You can see a the patterns that Spree specifically sets here:

HTH,

Brian Quinn

-------------------------------------------
Spree Commerce Inc.
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
-------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Tom

unread,
Jan 21, 2012, 8:13:58 PM1/21/12
to Spree
Brian, thanks. That works! ;- )

On Jan 18, 3:18 am, Brian Quinn <br...@spreecommerce.com> wrote:
> Hi Thomas,
> By adding the require into the all.js / all.css this will copy the contents of jqueru.fileupload-ui  into the compiled all.js/css file.
>
> In order to have that file precompiled standalone, you need to add a pattern to match as follows (in application.rb)
>
> config.assets.precompile += ['jquery.fileupload-ui.*']
>
> You can see a the patterns that Spree specifically sets here:https://github.com/spree/spree/blob/master/core/lib/spree/core/engine...
> > To post to this group, send email to spree...@googlegroups.com (mailto:spree...@googlegroups.com).
> > To unsubscribe from this group, send email to spree-user+...@googlegroups.com (mailto:spree-user+...@googlegroups.com).
Reply all
Reply to author
Forward
0 new messages