Serve your rolled up bundle like webpack-dev-server
Switch branches/tags
Nothing to show
Clone or download
thgh Merge pull request #19 from chge/master
Allow to override path for historyApiFallback option
Latest commit 930f3b3 Sep 18, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Initial commit Sep 24, 2016
src Merge pull request #19 from chge/master Sep 18, 2018
test Add some tests Jul 2, 2017
.gitignore Add some tests Jul 2, 2017 Add openPage option. Sep 8, 2018 Initial commit Sep 24, 2016 Merge pull request #19 from chge/master Sep 18, 2018
package.json v0.5.0 Sep 18, 2018
rollup.config.js Fix rollup warnings Aug 25, 2017
yarn.lock Remove unneeded rollup-watch dependency Aug 24, 2017

Rollup plugin to serve the bundle

Software License Issues JavaScript Style Guide NPM Latest Version


npm install --save-dev rollup-plugin-serve


// rollup.config.js
import serve from 'rollup-plugin-serve'

export default {
  input: 'entry.js',
  output: {
    file: 'dist/bundle.js',
    format: ...
  plugins: [


By default it serves the current project folder. Change it by passing a string:

serve('public')    // will be used as contentBase

// Default options
  // Launch in browser (default: false)
  open: true,

  // Page to navigate to when opening the browser.
  // Will not do anything if open=false.
  // Remember to start with a slash.
  openPage: '/different/page',

  // Show server address in console (default: true)
  verbose: false,

  // Folder to serve files from
  contentBase: '',

  // Multiple folders to serve from
  contentBase: ['dist', 'static'],

  // Set to true to return index.html instead of 404
  historyApiFallback: false,

  // Return override.html instead of 404
  historyApiFallback: '/override.html',

  // Options used in setting up server
  host: 'localhost',
  port: 10001,

  // By default server will be served over HTTP (https: false). It can optionally be served over HTTPS
  https: {
    key: fs.readFileSync('/path/to/server.key'),
    cert: fs.readFileSync('/path/to/server.crt'),
    ca: fs.readFileSync('/path/to/ca.pem')

  //set headers
  headers: {
    'Access-Control-Allow-Origin': '*',
    foo: 'bar'


Please see CHANGELOG for more information what has changed recently.


Contributions and feedback are very welcome.

This project aims to stay lean and close to standards. New features should encourage to stick to standards. Options that match the behaviour of webpack-dev-server are always ok.

To get it running:

  1. Clone the project.
  2. npm install
  3. npm run build



The MIT License (MIT). Please see License File for more information.