connect-asset

connect middleware for asset compiler

connect-asset

npm install connect-asset

app.use(require('connect-asset'));

or

app.use(require('connect-asset')({...options...}));
link(rel='stylesheet', href='css/style.css')
app
├ app.coffee
├ assets
│  └ css
│      └ style.styl
└ public
  • stylus
  • coffee-script

path for assets directory.

Default, path.resolve('assets').

path for public directory (web root).

Default, path.resolve('public').

save compiled code to public directory.

Default, if NODE_ENV=production then true else false.

minify compiled code or not.

Default, if NODE_ENV=production then true else false.

re-build assets when modification time differ from Last-Modified header.

Default, true.

target extension.

Default, .styl.[^1]

target extension.

Default, .coffee.[^2]

[^1]: .styl is ok, styl is ok too. [^2]: .coffee is ok, coffee is ok too.