New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-hotreload

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-hotreload

Hot Reload plugin for Rollup.js

  • 2.3.1
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-hotreload

Hot Reload plugin for Rollup.js

Coverage Status

Feature

  • Multiple files hotreload supported
  • Auto injected into HTML supported
  • EventSource (depended on browsers)

How to use

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;

Installation

  • NPM
$npm install rollup-plugin-hotreload --save-dev
  • CDN
<script src="https://unpkg.com/rollup-plugin-hotreload">

Test

$npm run test

Build

$npm run build

ChangeLog

Contributing

Feel free to fork and PR

Issues

License

MIT

FAQs

Package last updated on 29 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc