Registry / type-stubs / rollup-plugin-svelte-types

rollup-plugin-svelte-types

JSON →
library1.0.6jsnpmunverified

A Rollup plugin that generates TypeScript declaration (.d.ts) files for Svelte components, extracting props and events types. Version 1.0.6 is current; no frequent releases. Key differentiator: automates type generation for Svelte components in Rollup builds, reducing manual type work.

npm install rollup-plugin-svelte-types
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-SVEL
R
rollup-plugin-svelte-types
type-stubsjavascriptv1.0.6
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

default
✓ import svelteDts from 'rollup-plugin-svelte-types'
✗ const svelteDts = require('rollup-plugin-svelte-types')
ESM import is default; CommonJS require works but may have interop issues.
svelteDts
✓ import svelteDts from 'rollup-plugin-svelte-types'
✗ import { svelteDts } from 'rollup-plugin-svelte-types'
Package exports a single default function, not named export.
PluginOptions
✓ import type { PluginOptions } from 'rollup-plugin-svelte-types'
✗ import { PluginOptions } from 'rollup-plugin-svelte-types'
Type import for TypeScript users; not a runtime value.

Minimal Rollup config using svelteDts plugin with custom libRoot and declarationDir, alongside svelte and resolve plugins.

import svelteDts from 'rollup-plugin-svelte-types'; import svelte from 'rollup-plugin-svelte'; import resolve from '@rollup/plugin-node-resolve'; export default { input: 'src/main.js', output: { dir: 'public', format: 'esm' }, plugins: [ svelteDts({ libRoot: './src', declarationDir: './dist/types' }), svelte(), resolve() ] };
Debug
Known issues
gotchaPlugin requires svelte and svelte/compiler as implicit dependencies; does not install them automatically.
fix
Ensure svelte is installed in your project.
affects: *
breakingIn version 1.0.0, the default declaration directory changed from './types' to './dist/types' only if libRoot is not set.
fix
Set declarationDir explicitly to control output location.
affects: >=1.0.0 <1.0.1
deprecatedOptions `tsconfig` and `compilerOptions` were deprecated in v1.0.0; use TypeScript project configuration instead.
fix
Ensure tsconfig.json is present; remove `tsconfig` and `compilerOptions` from plugin config.
affects: >=1.0.0
gotchaPlugin may generate type errors if Svelte components have TypeScript syntax but no tsconfig covers the src directory.
fix
Place a tsconfig.json in your project root or set `libRoot` to a directory with a tsconfig.
affects: *
Errors
Common errors & fixes
Error: Could not find module 'svelte/compiler'
Missing svelte package in node_modules.
fix
npm install svelte --save-dev
Error: Cannot find module 'rollup-plugin-svelte-types'
Package not installed or incorrect import path.
fix
npm install rollup-plugin-svelte-types --save-dev
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
rolluprequiredPeer dependency, requires Rollup >=1.20.0.
Agent activity
33 hits · last 30 days
node
30
Amazon
1
OpenAI (training)
1
Resources
rollup-plugin-svelte-types — npm install rollup-plugin-svelte-types · libregistry