example for single-page webapp
├── component.json #define package
├── example.html
├── readme.md
└── source
├── index.css #main css
├── index.js #main js
├── handler.js #handler with history.pushState
├── tpl.js
└── tpl
├── builder.js #build ./*.jade > ../tpl.js
├── 404.jade
├── base.jade
└── login.jade
npm install component -g
#1.build from source
npm install jade
git clone https://github.com/yanyaoer/component-static {{ static_path }}
cd {{ static_path }}
#2.get static_file only
component install yanyaoer/component-static@master
component install
component build
cd {{ static_path }}
python -m SimpleHTTPServer 9001
open -a http://0.0.0.0:9001/example.html
# add to .vimrc
let $static_path = {{ static_path }}
function! Static_build()
if expand('%:e') == 'jade'
execute '!cd '.$static_path.'source/tpl/; node builder.js'
endif
execute '!cd '.$static_path.'; component build'
endfunction
au bufwritepost * if expand('%:p') =~ expand($static_path) | silent call Static_build() | endif
or write script with visionmedia-watch