$ npm install postcss-middleware
var postcssMiddleware = require ( 'postcss-middleware' ) ;
import * as postcssMiddleware from 'postcss-middleware' ;
const connect = require ( 'connect' ) ;
const app = connect ( ) ;
app . use ( '/css' , postcssMiddleware ( /* options */ ) ) ;
const express = require ( 'express' ) ;
const app = express ( ) ;
app . use ( '/css' , postcssMiddleware ( /* options */ ) ) ;
app . use ( postcssMiddleware ( {
plugins : [ /* plugins */ ] ,
options : {
parser : require ( 'sugarss' ) ,
map : { inline : false }
}
}
} ) ;
var path = require ( 'path' ) ;
app . use ( '/css' , postcssMiddleware ( {
src : function ( req ) {
return path . join ( 'styles' , req . path ) ;
} ,
plugins : [ /* plugins */ ]
} ) ;
var path = require ( 'path' ) ;
app . use ( / ^\/css\/([a-z-]+)\.css$ / , postcssMiddleware ( {
src : function ( req ) {
var folder = req . params [ zero ] ;
return path . join ( 'styles' , folder , '*.css' ) ;
} ,
plugins : [ /* plugins */ ]
} ) ;