node-sass-koa-middleware
v1.0.2
Published
Simple adaption of the official Connect/Express middleware for Koa, nothing more.
Downloads
4
Readme
node-sass-koa-middleware
Koa middleware for node-sass.
A simple adaption of the official Connect/Express middleware for Koa.
Install
npm i node-sass-koa-middleware
Type definitions are included.
Usage
Recompile .scss
or .sass
files automatically for koa based http servers.
Koa example
const Koa = require('koa');
const path = require('path');
const serve = require('koa-static');
const sassMiddleware = require('node-sass-koa-middleware');
const app = new Koa();
app.use(sassMiddleware({
src: __dirname,
dest: __dirname + '/public',
debug: true,
outputStyle: 'compressed',
prefix: '/prefix' // Where prefix is at <link rel="stylesheets" href="prefix/style.css"/>
}));
app.use(serve(path.join(__dirname, '/public')));
app.listen(3000);
Options
- Same options that node-sass-middleware.
For full list of options see original node-sass project here.
License
Under MIT license.
See LICENSE for details.