Skip to content

Instantly share code, notes, and snippets.

@dylants
Last active December 15, 2015 00:59
Show Gist options
  • Save dylants/5176618 to your computer and use it in GitHub Desktop.
Save dylants/5176618 to your computer and use it in GitHub Desktop.
less middleware app.js
var lessMiddleware = require("less-middleware");
app.use(lessMiddleware({
src: __dirname + "/less",
dest: __dirname + "/public/css",
// if you're using a different src/dest directory, you
// MUST include the prefex, which matches the dest
// public directory
prefix: "/css",
// force true recompiles on every request... not the
// best for production, but fine in debug while working
// through changes
force: true
}));
app.use(express.static(__dirname + "/public"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment