{"id":22239,"library":"rollup-plugin-svelte-hot","title":"rollup-plugin-svelte-hot","description":"Rollup plugin for compiling Svelte components with built-in Hot Module Replacement (HMR) support. Version 1.0.0-8, pre-release, requires Rollup >= 2.0.0 and Svelte >= 3.5.0. Supports both Rollup and Nollup bundlers. Unlike standard rollup-plugin-svelte, this plugin adds HMR capabilities, making it suitable for development workflows. Maintained by rixo, with TypeScript definitions included. Release cadence is irregular, with multiple alpha/beta tags.","status":"active","version":"1.0.0-8","language":"javascript","source_language":"en","source_url":"https://github.com/rixo/rollup-plugin-svelte","tags":["javascript","svelte","hot","hmr","nollup","rollup","typescript"],"install":[{"cmd":"npm install rollup-plugin-svelte-hot","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-svelte-hot","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-svelte-hot","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for bundling","package":"rollup","optional":false},{"reason":"Required peer dependency for Svelte compilation","package":"svelte","optional":false},{"reason":"Runtime needed for HMR functionality (automatically installed as dependency)","package":"svelte-hmr","optional":false}],"imports":[{"note":"ESM exports default function. CJS require() works in Node.js, but ESM is preferred for bundlers.","wrong":"const svelte = require('rollup-plugin-svelte-hot')","symbol":"default","correct":"import svelte from 'rollup-plugin-svelte-hot'"},{"note":"Named export 'svelte' is also available, same as default.","wrong":"import { rollupPluginSvelte } from 'rollup-plugin-svelte-hot'","symbol":"svelte","correct":"import { svelte } from 'rollup-plugin-svelte-hot'"},{"note":"Optional helper for setting HMR options, TypeScript typed.","wrong":null,"symbol":"hotOptions","correct":"import { hotOptions } from 'rollup-plugin-svelte-hot'"}],"quickstart":{"code":"import svelte from 'rollup-plugin-svelte-hot';\nimport resolve from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\nimport livereload from 'rollup-plugin-livereload';\nimport { terser } from 'rollup-plugin-terser';\n\nconst production = !process.env.ROLLUP_WATCH;\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    sourcemap: true,\n    format: 'iife',\n    name: 'app',\n    file: 'public/build/bundle.js'\n  },\n  plugins: [\n    svelte({\n      dev: !production,\n      css: css => css.write('public/build/bundle.css'),\n      hot: production ? false : {}\n    }),\n    resolve({ browser: true, dedupe: ['svelte'] }),\n    commonjs(),\n    !production && livereload('public'),\n    production && terser()\n  ]\n};","lang":"javascript","description":"Minimal Rollup config with svelte-hot, HMR, dev server, and production minification."},"warnings":[{"fix":"Upgrade rollup and svelte to meet minimum versions.","message":"Requires rollup >= 2.0.0 and svelte >= 3.5.0","severity":"breaking","affected_versions":"<0.10"},{"fix":"Explicitly install nollup if using Nollup.","message":"Nollup dependency is optional since v0.14.1; may be removed in future.","severity":"deprecated","affected_versions":">=0.14.1"},{"fix":"Add 'dedupe: ['svelte']' to resolve options.","message":"Ensure 'svelte' is deduplicated in @rollup/plugin-node-resolve to avoid multiple Svelte instances.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'const production = !process.env.ROLLUP_WATCH' and conditionally enable hot.","message":"HMR only works in 'dev' mode; set 'hot' to false or omit in production.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to 0.11.2+ or ignore blank CSS file.","message":"CSS output with HMR: writes a blank CSS file; suppresses warning with Nollup.","severity":"gotcha","affected_versions":"<=0.11.2"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install svelte: npm install --save-dev svelte","cause":"Missing or mismatched Svelte peer dependency.","error":"Error: Cannot find module 'svelte/compiler'"},{"fix":"Add @rollup/plugin-node-resolve with dedupe: ['svelte']","cause":"Svelte not resolved by plugin.","error":"Error: [!] RollupError: Could not resolve 'svelte'"},{"fix":"Use @rollup/plugin-node-resolve, not webpack.","cause":"Webpack context in Rollup config.","error":"Module not found: Error: Can't resolve 'svelte'"},{"fix":"Use import svelte from 'rollup-plugin-svelte-hot'","cause":"Using require() in ES module context.","error":"TypeError: svelte is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}