1.0.0 • Published 5 years ago
rollup-dev v1.0.0
Rollup Dev Server
Serves your app and reloads when files change
Features
- 🚀 Easy setup
- 🔍 Built-in error overlay
Getting started
Installation
yarn add rollup-devor
npm i rollup-devSetting up your app
For now there's no way to automatically inject client script (like
webpack-dev-server does) so you need to include it yourself. This should be
done in a place closest to the entry point.
import { setupClient } from "rollup-dev/dist/client";
if (process.env.NODE_ENV !== "production") {
setupClient();
}Note: you should import directly from
rollup-dev/dist/clientto prevent bundling the server
Running the server
Once client is included in the application, you can run the server which will watch for changes and reload the client when needed. The easiest way is to use the CLI utility.
cd /path/to/app
rollup-dev ./distNote:
./distpoints to the static files, change it if your build destination is different
The CLI also takes some useful options:
--port- Choose a different port to run on--config- Set path torollup.config.jsfile
Note: If your config file is not
rollup.config.js, you must change--configoption
License
1.0.0
5 years ago