Merging CSS into single file

38 views
Skip to first unread message

AdrianLC

unread,
Oct 6, 2013, 12:55:46 PM10/6/13
to django-...@googlegroups.com
Hello,

It's my first time using require.js and I love how your app can automatically plug in the optimizer to collectstatic.

I see that r.js can combine the css files into a single stylesheet just like with the js scripts. collecstatic is running uglify2 on them but they aren't being merged.

My question is: Can this be done through django-require, or would I need to do it manually?

Thank you!

AdrianLC

unread,
Oct 6, 2013, 2:33:01 PM10/6/13
to django-...@googlegroups.com

I have another doubt.

Can I build without almond.js? The built script is failing to load django's javascript gettext, and I think it might be because almond doesn't support remote resources:

Restrictions

It is best used for libraries or apps that use AMD and:

  • optimize all the modules into one file -- no dynamic code loading.
  • ...
Have you ever loaded the javascript translations through django-require ? If so, how, please?
 
 
 
 



Dave Hall

unread,
Oct 7, 2013, 4:47:38 AM10/7/13
to AdrianLC, django-...@googlegroups.com
Merging CSS is easy. Just load the one CSS file in your HTML, and from that CSS file @import() all the other CSS files you're using. They'll all be inlined according to your import rules.

Building without almond.js is the default. Simply leave REQUIRE_STANDALONE_MODULES empty and add your modules to the `modules` section in your app.build.js.


--
You received this message because you are subscribed to the Google Groups "django-require discussion and announcements" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-requir...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

AdrianLC

unread,
Oct 8, 2013, 2:29:35 PM10/8/13
to django-...@googlegroups.com, AdrianLC
Ok, got it working. Thanks!
Reply all
Reply to author
Forward
0 new messages