rollup-plugin-koa-devserver

0.10.2 • Public • Published

rollup-plugin-koa-devserver

A Rollup development server implemented using koa-devserver.

Features

  • Built-in live reload using livereload.
  • Displaying build errors in the browser when build fails.
  • Customizable build error page.
  • Customizable middleware stack - you can use any existing Koa plugins to configure your middleware stack. Or you can write your own middleware if needed.

Usage

To install:

npm install -D rollup-plugin-koa-devserver

In rollup.config.js:

import devServer from 'rollup-plugin-koa-devserver';
import cors from '@koa/cors';

export default {
    input: './src/index.js',
    output: {
        // your build output here
    },
    plugins: [
        // your build plugins here:
        // ...plugins,
        devServer({
            port: 8088,
            open: '/build/dev/index.html',
            livereload: 'build/dev',
            use: [ cors() ]
        })
    ]
}

For the full list of options see the koa-devserver documentation.

License

MIT

Authors

Bogdan Stefanescu - Intial Work - Quandora

Package Sidebar

Install

npm i rollup-plugin-koa-devserver

Weekly Downloads

1

Version

0.10.2

License

MIT

Unpacked Size

5.5 kB

Total Files

5

Last publish

Collaborators

  • bstefanescu