{"id":26335,"library":"rollup-plugin-uniroll-svelte","title":"rollup-plugin-uniroll-svelte","description":"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.","status":"active","version":"4.0.1-alpha.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install rollup-plugin-uniroll-svelte","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-uniroll-svelte","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-uniroll-svelte","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Rollup plugin compatibility.","package":"rollup","optional":false},{"reason":"Peer dependency; only Svelte 3.x is supported.","package":"svelte","optional":false},{"reason":"Peer dependency for TypeScript support in Uniroll.","package":"typescript","optional":false},{"reason":"Peer dependency; plugin is designed to work with Uniroll bundler.","package":"uniroll","optional":false}],"imports":[{"note":"Default export is not available; use named export `svelte`.","wrong":"const plugin = require('rollup-plugin-uniroll-svelte')","symbol":"svelte","correct":"import { svelte } from 'rollup-plugin-uniroll-svelte'"},{"note":"This utility is located in a subpath; exporting from main entry is not supported.","wrong":"import { createStylePreprocessor } from 'rollup-plugin-uniroll-svelte'","symbol":"createStylePreprocessor","correct":"import { createStylePreprocessor } from 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'"},{"note":"`bundle` is part of Uniroll, not this plugin.","wrong":"import { bundle } from 'rollup-plugin-uniroll-svelte'","symbol":"bundle","correct":"import { bundle } from 'uniroll'"}],"quickstart":{"code":"import ts from \"typescript\";\nimport { bundle } from \"uniroll\";\nimport { svelte } from \"rollup-plugin-uniroll-svelte\";\n\nconst files = {\n  \"/index.svelte\": `<script>let count = 0</script><button on:click={() => count++}>{count}</button>`\n};\n\nconst cdnPrefix = \"https://cdn.skypack.dev/\";\n\nasync function main() {\n  const result = await bundle({\n    input: \"/index.svelte\",\n    files,\n    extraPlugins: [\n      svelte({\n        target: ts.ScriptTarget.ES2019,\n        cdnPrefix,\n        svelteOptions: {}\n      })\n    ]\n  });\n  console.log(result);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Minimal example: bundle a Svelte component using Uniroll and the Svelte plugin."},"warnings":[{"fix":"Update Uniroll to v4 and ensure Svelte is version 3.x.","message":"Breaking change in v4: The plugin now requires Uniroll v4 and Svelte 3.x only.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use the new import path from 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'.","message":"The `createStylePreprocessor` import path changed from 'rollup-plugin-uniroll-svelte/lib/stylePreproccessor' to 'rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor'.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use Svelte 3.x or prepare to migrate to a different Svelte Rollup plugin.","message":"The plugin does not work with Svelte 4.x; only Svelte 3.x is supported.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use Skypack CDN (https://cdn.skypack.dev/) as shown in examples.","message":"CDN resolution for Svelte internal modules (like 'svelte/internal') may fail with some CDNs (e.g., esm.sh).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use `import { svelte } from 'rollup-plugin-uniroll-svelte'` instead of `import svelte from 'rollup-plugin-uniroll-svelte'`.","message":"The plugin now exports only named exports; default export was removed.","severity":"breaking","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Switch to Skypack CDN: `cdnPrefix: 'https://cdn.skypack.dev/'`.","cause":"The CDN provider (e.g., esm.sh) does not resolve Svelte's internal modules correctly.","error":"Error: Cannot find module 'svelte/internal'"},{"fix":"Use `import { svelte } from 'rollup-plugin-uniroll-svelte'`.","cause":"Using default import instead of named import. The module exports `svelte` as a named export.","error":"TypeError: svelte is not a function"},{"fix":"Downgrade Svelte to 3.x: `npm install svelte@3`.","cause":"Installed Svelte version is incompatible.","error":"Error: The plugin 'rollup-plugin-uniroll-svelte' requires Svelte version 3.x, but you have 4.x installed."},{"fix":"Update import to `rollup-plugin-uniroll-svelte/lib/server/stylePreproccessor`.","cause":"Import path for `createStylePreprocessor` changed in v4.","error":"Cannot find module 'rollup-plugin-uniroll-svelte/lib/stylePreproccessor'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}