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

rollup-plugin-uniroll-svelte

JSON →
library4.0.1-alpha.0jsnpmunverified

A Rollup plugin that integrates Svelte compilation with Uniroll, enabling bundling of Svelte components in browser or Node environments. Current version is 4.0.1-alpha.0, with pre-release status and active development. It provides TypeScript support, configurable Svelte compiler options, and compatibility with Uniroll's bundling pipeline. Differentiators include support for IE via ES5 transpilation, CSS extraction instead of injection, and integration with esm.sh for CDN resolution. Requires Svelte 3.x, Rollup, and Uniroll as peer dependencies.

npm install rollup-plugin-uniroll-svelte
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-UNIR
R
rollup-plugin-uniroll-svelte
web-frameworkjavascriptv4.0.1-alpha.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

svelte
import { svelte } from 'rollup-plugin-uniroll-svelte'
const plugin = require('rollup-plugin-uniroll-svelte')
Default export is not available; use named export `svelte`.
createStylePreprocessor
import { createStylePreprocessor } from 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'
import { createStylePreprocessor } from 'rollup-plugin-uniroll-svelte'
This utility is located in a subpath; exporting from main entry is not supported.
bundle
import { bundle } from 'uniroll'
import { bundle } from 'rollup-plugin-uniroll-svelte'
`bundle` is part of Uniroll, not this plugin.

Minimal example: bundle a Svelte component using Uniroll and the Svelte plugin.

import ts from "typescript"; import { bundle } from "uniroll"; import { svelte } from "rollup-plugin-uniroll-svelte"; const files = { "/index.svelte": `<script>let count = 0</script><button on:click={() => count++}>{count}</button>` }; const cdnPrefix = "https://cdn.skypack.dev/"; async function main() { const result = await bundle({ input: "/index.svelte", files, extraPlugins: [ svelte({ target: ts.ScriptTarget.ES2019, cdnPrefix, svelteOptions: {} }) ] }); console.log(result); } main().catch(console.error);
Debug
Known issues
breakingBreaking change in v4: The plugin now requires Uniroll v4 and Svelte 3.x only.
fix
Update Uniroll to v4 and ensure Svelte is version 3.x.
affects: >=4.0.0
deprecatedThe `createStylePreprocessor` import path changed from 'rollup-plugin-uniroll-svelte/lib/stylePreproccessor' to 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'.
fix
Use the new import path from 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'.
affects: >=4.0.0
gotchaThe plugin does not work with Svelte 4.x; only Svelte 3.x is supported.
fix
Use Svelte 3.x or prepare to migrate to a different Svelte Rollup plugin.
affects: >=0.0.0
gotchaCDN resolution for Svelte internal modules (like 'svelte/internal') may fail with some CDNs (e.g., esm.sh).
fix
Use Skypack CDN (https://cdn.skypack.dev/) as shown in examples.
affects: >=0.0.0
breakingThe plugin now exports only named exports; default export was removed.
fix
Use `import { svelte } from 'rollup-plugin-uniroll-svelte'` instead of `import svelte from 'rollup-plugin-uniroll-svelte'`.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'svelte/internal'
The CDN provider (e.g., esm.sh) does not resolve Svelte's internal modules correctly.
fix
Switch to Skypack CDN: `cdnPrefix: 'https://cdn.skypack.dev/'`.
TypeError: svelte is not a function
Using default import instead of named import. The module exports `svelte` as a named export.
fix
Use `import { svelte } from 'rollup-plugin-uniroll-svelte'`.
Error: The plugin 'rollup-plugin-uniroll-svelte' requires Svelte version 3.x, but you have 4.x installed.
Installed Svelte version is incompatible.
fix
Downgrade Svelte to 3.x: `npm install svelte@3`.
Cannot find module 'rollup-plugin-uniroll-svelte/lib/stylePreproccessor'
Import path for `createStylePreprocessor` changed in v4.
fix
Update import to `rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor`.
Upgrade
Version history
4.0.1-alpha.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency for Rollup plugin compatibility.
svelterequiredPeer dependency; only Svelte 3.x is supported.
typescriptrequiredPeer dependency for TypeScript support in Uniroll.
unirollrequiredPeer dependency; plugin is designed to work with Uniroll bundler.
Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-uniroll-svelte — npm install rollup-plugin-uniroll-svelte · libregistry