一覧へ戻る
tingwei628/rollup-plugin-hotreload(新しいタブで開きます)
主要言語: JavaScript
Hot Reload plugin for Rollup.js
- star 数
- 8
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 7
- 最終更新
- 2020/08/29
主要言語: JavaScript
Hot Reload plugin for Rollup.js
Hot Reload plugin for Rollup.js
NOTE: the rollup-plugin-hotreload server port is 9999
:DO NOT USE localhost server port as the same as 9999
rollup.config.js
import { rph, rphMultibundles } from "rollup-plugin-hotreload"; import path from "path"; import "your_server_path"; // import your server path; export default rphMultibundles({ //... plugins: [ rph({ templateHtmlPath: "src/index.html", // template html path relative to rootDir isStopRPH: false, // stop hotreload or not rootDir: __dirname, // rootDir rootBuildDir: "build", // build root path relative to rootDir buildPaths: [ // first one is relative path to rootDir... ["js/index.min.js", "src/index.js"] // as many as you want ... ] }) ] });
your_server.js
// koa@2.6.2 import Koa from 'koa'; import koaSend from 'koa-send'; const server = new Koa(); server.use(async ctx => { await koaSend(ctx, ctx.path, { root: __dirname + '/build' }); }); server.listen(3005); export default server;
$npm install rollup-plugin-hotreload --save-dev
<script src="https://unpkg.com/rollup-plugin-hotreload">
$npm run test
$npm run build
Feel free to fork and PR
MIT