{"id":22054,"library":"rollup-plugin-hot","title":"rollup-plugin-hot","description":"HMR (Hot Module Replacement) plugin for Rollup, leveraging SystemJS. Current stable version 0.1.1, released in Aug 2020. This is a proof-of-concept, not production-ready. It forces output format to 'system' during HMR and provides a dev server with proxy support. Key differentiator: it enables live reload and stateful HMR for Rollup-built apps, using SystemJS for module loading. However, it has limited maintenance and lacks support for Rollup 3+.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/rixo/rollup-plugin-hot","tags":["javascript","rollup","rollup-plugin","hmr"],"install":[{"cmd":"npm install rollup-plugin-hot","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-hot","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-hot","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package exports a single default function. CommonJS destructuring will return undefined.","wrong":"const { hmr } = require('rollup-plugin-hot')","symbol":"default (hmr function)","correct":"import hmr from 'rollup-plugin-hot'"},{"note":"Named export does not exist.","wrong":"import { hot } from 'rollup-plugin-hot'","symbol":"Rollup config usage","correct":"import hmr from 'rollup-plugin-hot'; export default { plugins: [hmr({ enabled: true })] }"},{"note":"Package lacks TypeScript definitions; use @ts-ignore or declare module.","wrong":"import hmr from 'rollup-plugin-hot'; // no types","symbol":"TypeScript integration","correct":"// @ts-ignore\nimport hmr from 'rollup-plugin-hot'"}],"quickstart":{"code":"import hmr from 'rollup-plugin-hot';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    dir: 'public',\n    format: 'iife',\n    sourcemap: true,\n  },\n  plugins: [\n    hmr({\n      enabled: true,\n      public: 'public',\n      baseUrl: '/',\n      port: 33440,\n      open: 'default',\n      openPage: '/',\n    }),\n  ],\n};\n\n// Run rollup --watch to enable HMR","lang":"javascript","description":"Basic Rollup configuration with rollup-plugin-hot. Sets up HMR dev server on port 33440, watches for changes, and opens browser."},"warnings":[{"fix":"Do not rely on output format during development; use format: 'iife' only for production builds without HMR.","message":"Output format is overridden to 'system' when HMR is running, regardless of what is set in config.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use Rollup 2.x or find alternative HMR plugin for Rollup 3+.","message":"Peer dependency rollup >=1.24.0 <3 – incompatible with Rollup 3+.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Test thoroughly before using in production; consider alternatives like @rollup/plugin-replace or webpack for stable HMR.","message":"The plugin is a proof of concept and not production-ready; may exhibit unexpected behavior with other plugins.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set randomPortFallback: false if you need a deterministic port.","message":"The option 'randomPortFallback' defaults to true; may cause port conflicts if not set explicitly.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure all HMR-accepting modules have proper URLs; rely on full-page reload for other files.","message":"Files without a URL (e.g., non-JS) are not handled by HMR and can cause errors.","severity":"gotcha","affected_versions":">=0.1.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev rollup-plugin-hot","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'rollup-plugin-hot'"},{"fix":"Change to: import hmr from 'rollup-plugin-hot'","cause":"Using destructured import with named export instead of default import.","error":"TypeError: hmr is not a function"},{"fix":"Downgrade Rollup to version 2.x.","cause":"Using incompatible Rollup version (3+).","error":"Error: This plugin only works with rollup >=1.24.0 <3"},{"fix":"Ensure output.dir or output.file is set; consider using single bundle output format.","cause":"HMR forces 'system' format, which may conflict with other output options like 'dir' or 'file'.","error":"Module format 'system' is not supported by Rollup for this output type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}