Registry /
web-framework / rollup-plugin-svelte-hot
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
muslnode 18–223 runs
build_error
glibcnode 18–223 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()
]
};
Errors
Common errors & fixes
Error: Cannot find module 'svelte/compiler'
Missing or mismatched Svelte peer dependency.
fixInstall svelte: npm install --save-dev svelte
Error: [!] RollupError: Could not resolve 'svelte'
Svelte not resolved by plugin.
fixAdd @rollup/plugin-node-resolve with dedupe: ['svelte']
Module not found: Error: Can't resolve 'svelte'
Webpack context in Rollup config.
fixUse @rollup/plugin-node-resolve, not webpack.
TypeError: svelte is not a function
Using require() in ES module context.
fixUse import svelte from 'rollup-plugin-svelte-hot'
Audit
Dependencies
rolluprequiredRequired peer dependency for bundling
svelterequiredRequired peer dependency for Svelte compilation
svelte-hmrrequiredRuntime needed for HMR functionality (automatically installed as dependency)