Registry / web-framework / rollup-plugin-svelte-hot

rollup-plugin-svelte-hot

JSON →
library1.0.0-8jsnpmunverified

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.

npm install rollup-plugin-svelte-hot
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SVEL
R
rollup-plugin-svelte-hot
web-frameworkjavascriptv1.0.0-8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import svelte from 'rollup-plugin-svelte-hot'
const svelte = require('rollup-plugin-svelte-hot')
ESM exports default function. CJS require() works in Node.js, but ESM is preferred for bundlers.
svelte
import { svelte } from 'rollup-plugin-svelte-hot'
import { rollupPluginSvelte } from 'rollup-plugin-svelte-hot'
Named export 'svelte' is also available, same as default.
hotOptions
import { hotOptions } from 'rollup-plugin-svelte-hot'
Optional helper for setting HMR options, TypeScript typed.

Minimal Rollup config with svelte-hot, HMR, dev server, and production minification.

import svelte from 'rollup-plugin-svelte-hot'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; const production = !process.env.ROLLUP_WATCH; export default { input: 'src/main.js', output: { sourcemap: true, format: 'iife', name: 'app', file: 'public/build/bundle.js' }, plugins: [ svelte({ dev: !production, css: css => css.write('public/build/bundle.css'), hot: production ? false : {} }), resolve({ browser: true, dedupe: ['svelte'] }), commonjs(), !production && livereload('public'), production && terser() ] };
Debug
Known issues
breakingRequires rollup >= 2.0.0 and svelte >= 3.5.0
fix
Upgrade rollup and svelte to meet minimum versions.
affects: <0.10
deprecatedNollup dependency is optional since v0.14.1; may be removed in future.
fix
Explicitly install nollup if using Nollup.
affects: >=0.14.1
gotchaEnsure 'svelte' is deduplicated in @rollup/plugin-node-resolve to avoid multiple Svelte instances.
fix
Add 'dedupe: ['svelte']' to resolve options.
affects: all
gotchaHMR only works in 'dev' mode; set 'hot' to false or omit in production.
fix
Use 'const production = !process.env.ROLLUP_WATCH' and conditionally enable hot.
affects: all
gotchaCSS output with HMR: writes a blank CSS file; suppresses warning with Nollup.
fix
Upgrade to 0.11.2+ or ignore blank CSS file.
affects: <=0.11.2
Errors
Common errors & fixes
Error: Cannot find module 'svelte/compiler'
Missing or mismatched Svelte peer dependency.
fix
Install svelte: npm install --save-dev svelte
Error: [!] RollupError: Could not resolve 'svelte'
Svelte not resolved by plugin.
fix
Add @rollup/plugin-node-resolve with dedupe: ['svelte']
Module not found: Error: Can't resolve 'svelte'
Webpack context in Rollup config.
fix
Use @rollup/plugin-node-resolve, not webpack.
TypeError: svelte is not a function
Using require() in ES module context.
fix
Use import svelte from 'rollup-plugin-svelte-hot'
Upgrade
Version history
1.0.0-8latest on npm
Audit
Dependencies
rolluprequiredRequired peer dependency for bundling
svelterequiredRequired peer dependency for Svelte compilation
svelte-hmrrequiredRuntime needed for HMR functionality (automatically installed as dependency)
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
rollup-plugin-svelte-hot — npm install rollup-plugin-svelte-hot · libregistry