{"id":22304,"library":"rollup-preset-solid","title":"Solid Rollup Preset","description":"A minimal, opinionated Rollup preset for bundling SolidJS libraries. v3.0.0 ships TypeScript types and supports ESM, CJS, UMD, JSX, and TSC output targets. Key differentiators: zero-config setup (two lines to start), automatic TypeScript, configurable targets, optional package.json generation, and best-practice export maps for SolidJS packages. Released under the MIT license with active maintenance. Suitable for both simple and multi-entry library builds, with support for IIFE builds and globals configuration.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup","preset","solidjs","typescript"],"install":[{"cmd":"npm install rollup-preset-solid","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-preset-solid","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-preset-solid","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for bundling","package":"rollup","optional":false},{"reason":"Implicitly used for TypeScript compilation","package":"@rollup/plugin-typescript","optional":true}],"imports":[{"note":"ESM-only package; will throw with require().","wrong":"const withSolid = require('rollup-preset-solid')","symbol":"withSolid","correct":"import withSolid from 'rollup-preset-solid'"},{"note":"Exported as default, not named.","wrong":"import { withSolid } from 'rollup-preset-solid'","symbol":"default","correct":"import withSolid from 'rollup-preset-solid'"},{"note":"Options is a TypeScript interface only; not runtime value.","wrong":"import { Options } from 'rollup-preset-solid'","symbol":"Options (type)","correct":"import type { Options } from 'rollup-preset-solid'"}],"quickstart":{"code":"// rollup.config.js\nimport withSolid from 'rollup-preset-solid';\n\nexport default withSolid({\n  input: 'src/index.tsx',\n  targets: ['esm', 'cjs'],\n  printInstructions: true,\n});","lang":"typescript","description":"Demonstrates minimal config with ESM and CJS outputs, plus hints for package.json fields."},"warnings":[{"fix":"Either provide globals mapping or override external: [] to bundle them.","message":"IIFE builds now treat solid-js, solid-js/web, and solid-js/store as external by default.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace format: 'esm' with targets: ['esm'].","message":"The 'format' option is deprecated in favor of 'targets' array.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Always specify input for each config object in array.","message":"If you pass multiple configs (array), each entry must have its own input. Missing input causes build failure.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Switch to import syntax or set type: 'module' in package.json.","cause":"Using CommonJS require() with ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use default import: import withSolid from 'rollup-preset-solid'.","cause":"Named import instead of default import.","error":"TypeError: withSolid is not a function"},{"fix":"Provide globals option or override external to empty array.","cause":"IIFE build with external modules but no globals.","error":"Module 'solid-js' is marked as external but no global mapping is provided"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}