node package manager


middleware to demand combine and minify resources

var minify = require('connect-minify');

  // assets map - maps served file identifier to a list of resources
  assets: {
    "/js/main.min.js": [
    "/css/home.min.css": [
    "/css/dashboard.min.css": [
    ] },
  // root - where resources can be found
  root: path.join(__dirname, '..', 'static),
  // default is to minify files
  disable_minification: false

Then later to generate a URL:

app.use(function(req, res, next) {

Or to do the same in a template:

  <script src="<%- minifiedURL('/js/main.min.js') %>"></script>