JSPM

node-sass-koa-middleware

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q18374F

Simple adaption of the official Connect/Express middleware for Koa, nothing more.

Package Exports

  • node-sass-koa-middleware

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-sass-koa-middleware) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-sass-koa-middleware

Koa middleware for node-sass.
A simple adaption of the official Connect/Express middleware for Koa.

npm version Dependency Status devDependency Status Gitter chat

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

For full list of options see original node-sass project here.

License

Under MIT license.
See LICENSE for details.