lightweight devserver with livereload and hotcss swaps
npm install rollup-plugin-devsuiterollup.config.js
js
import devsuite from "rollup-plugin-devsuite";
const prod = !process.env.ROLLUP_WATCH;
export default {
//...
plugins: [
//...
!prod && devsuite({
dir: "public", //default
port: 3000, //default
host: "localhost", //default
index: "index.html", //default
proxy: {} //default
})
]
}
`
$3
The proxy can be used to map a route on the devserver for example to your api
Basically the following example maps localhost:3000/api/hello to api.example.com/hello
`js
//...
proxy: {"/api/": "api.example.com"}
//...
`
or you could map localhost:3000/api/hello to example.com/api/hello with this
`js
//...
proxy: {"/api/": "example.com/api"}
//...
`
Both of these following examples should give an identical result
`js
//...
proxy: {"/api/": ...}
proxy: {"/api": ...}
//...
``