Is there an option in Jade to embed the asset files (javascript and css files) directly in document?

21 views
Skip to first unread message

Liu Shuping

unread,
Aug 23, 2014, 11:22:00 AM8/23/14
to jad...@googlegroups.com
I am wondering if there is a switch option defining if Jade render an asset file's link or content in the html document. I would like to reduce the HTTP round trips by putting all css file contents directly in the HTML content, but in 'Debug' mode I still want the styles in a separated file.

Forbes Lindesay

unread,
Aug 24, 2014, 7:21:55 AM8/24/14
to jad...@googlegroups.com
We don’t currently have anything like this in jade.  I would suggest that it’s probably preferable to do this after the file has been converted into HTML as part of some kind of asset pipeline.  It feels out of scope to do it in jade.  I would also be cautious of premature optimisation, it’s usually enough to just concatenate all your styles into one file and all your JavaScript into one file.  The two extra network requests will often be paid back in the reduced parsing time for the resulting HTML.

Developments like SPDY could also obsolete this inlining process.

Forbes Lindesay

On 2014-08-23, at 16:22, Liu Shuping <lsp...@gmail.com> wrote:

I am wondering if there is a switch option defining if Jade render an asset file's link or content in the html document. I would like to reduce the HTTP round trips by putting all css file contents directly in the HTML content, but in 'Debug' mode I still want the styles in a separated file.

--
You received this message because you are subscribed to the Google Groups "Jade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jadejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages