admin 管理员组

文章数量: 1184232

I work in coffeescript, jade and stylus.

My application serves two different "one page apps". For these apps I serve all asset in the initial payload.

I want to group, pile, and concatenate all coffeescript files and jade templeates into a single js asset and stylus files into a single css asset for each "one page app".

Then I can just leave my /public/js and /public/css alone and they will always have the current js and css asset files for the two different apps.

Has anyone setup a workflow like this before? Any ideas how I could do this?

Through research I found the process written about here but they don't say how they did it.
/

I work in coffeescript, jade and stylus.

My application serves two different "one page apps". For these apps I serve all asset in the initial payload.

I want to group, pile, and concatenate all coffeescript files and jade templeates into a single js asset and stylus files into a single css asset for each "one page app".

Then I can just leave my /public/js and /public/css alone and they will always have the current js and css asset files for the two different apps.

Has anyone setup a workflow like this before? Any ideas how I could do this?

Through research I found the process written about here but they don't say how they did it.
http://blog.fogcreek./the-trello-tech-stack/

Share Improve this question edited May 23, 2023 at 8:46 Chenmunka 8137 gold badges27 silver badges35 bronze badges asked Jan 25, 2012 at 10:32 fancyfancy 51.5k64 gold badges157 silver badges230 bronze badges 1
  • Do you really need to submit the same question 3 times? – fent Commented Jan 25, 2012 at 22:36
Add a ment  | 

5 Answers 5

Reset to default 5

You can do this with JS pretty simply with Express + Stitch / StitchUp

Sample config: https://gist.github./1094412

An alternative is also Interleave:

http://www.distractable/coding/javascript-builds-using-interleave

And the options for stylus middleware should sort you out for your CSS: http://learnboost.github./stylus/docs/middleware.html

There's also a myriad of options over here:

http://toolbox.no.de/search?q=asset

I wrote a node app for this. It is V E R Y simple, but it works for me. The code is so simple (72 lines) you can adjust it anyway you like. Whenever you save a coffee, stylus or jade file it converts to js, css or html. It doesn't take care of file removals or any other fancy stuff. It's not perfect, but at least I know exactly how it works, which makes debugging easy.

https://github./Gijsjan/Template-Engine-Watcher

I wrote an open source project(MIT license) to address this problem:

Giles - https://github./255BITS/giles

Giles builds your static assets for you(Jade, Stylus, CoffeeScript). It can be run standalone, as a web server, or as a connect module. You can add support for other languages to Giles easily(see the github page)

You can use the connect-assets pipeline to pull piled Jade assets into your JavaScript by making them dependencies of the CoffeeScript files that use them.

I have a blog post with the details -> Server side piling of Jade templates with connect-assets.

I remend using Grunt, with Grunt you can setup all kinds of workflows and tasks. I personally use mean.io as my boilerplate for most of my projects. They have a really nice Grunt file with most the tasks you need to concat and minify css and js into a single file using assetmanager. Mean.io doesn't use jade or stylus but you could easily add those Grunt tasks.

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)