Skip to content

Loading…

Added LESS CSS support #13

Merged
merged 1 commit into from

2 participants

@btmills
@tj tj merged commit e7c4552 into tj:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 31, 2013
  1. @btmills

    Add LESS

    btmills committed
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +1 −0 Readme.md
  2. +7 −0 bin/serve
  3. +1 −0 package.json
View
1 Readme.md
@@ -21,6 +21,7 @@ Options:
-H, --hidden enable hidden file serving
-S, --no-stylus disable stylus rendering
-J, --no-jade disable jade rendering
+ --no-less disable less css rendering
-I, --no-icons disable icons
-L, --no-logs disable request logging
-D, --no-dirs disable directory serving
View
7 bin/serve
@@ -10,6 +10,7 @@ var resolve = require('path').resolve
, connect = require('connect')
, stylus = require('stylus')
, jade = require('jade')
+ , less = require('less-middleware')
, url = require('url')
, fs = require('fs');
@@ -23,6 +24,7 @@ program
.option('-H, --hidden', 'enable hidden file serving')
.option('-S, --no-stylus', 'disable stylus rendering')
.option('-J, --no-jade', 'disable jade rendering')
+ .option(' --no-less', 'disable less css rendering')
.option('-I, --no-icons', 'disable icons')
.option('-L, --no-logs', 'disable request logging')
.option('-D, --no-dirs', 'disable directory serving')
@@ -72,6 +74,11 @@ if (program.jade) {
// stylus
server.use(stylus.middleware({ src: path }));
+// less
+if (program.less) {
+ server.use(less({ src: path }));
+}
+
// static files
server.use(connect.static(path, { hidden: program.hidden }));
View
1 package.json
@@ -8,6 +8,7 @@
"connect": "2.3.x"
, "stylus": "*"
, "jade": "*"
+ , "less-middleware": "*"
, "commander": "0.6.1"
}
, "bin": { "serve": "./bin/serve" }
Something went wrong with that request. Please try again.