npm install --save-dev rollup-plugin-serve
// rollup.config.js
import serve from 'rollup-plugin-serve'
export default {
entry: 'entry.js',
dest: 'bundle.js',
plugins: [
serve('dist')
]
}
By default it serves the current project folder. Change it by passing a string:
serve('public') // will be used as contentBase
// Default options
serve({
// Launch in browser (default: false)
open: true,
// 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,
// Options used in setting up server
host: 'localhost',
port: 10001
})
master
Please see CHANGELOG for more information what has changed recently.
Contributions and feedback are very welcome.
To get it running:
- Clone the project.
npm install
npm run build
The MIT License (MIT). Please see License File for more information.