Registry / web-framework / rollup-preset-solid

rollup-preset-solid

JSON →
library3.0.0jsnpmunverified

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.

npm install rollup-preset-solid
INSTALL
IMPORT
SIG · ROLLUP-PRESET-SOLI
R
rollup-preset-solid
web-frameworkjavascriptv3.0.0
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.

withSolid
✓ import withSolid from 'rollup-preset-solid'
✗ const withSolid = require('rollup-preset-solid')
ESM-only package; will throw with require().
default
✓ import withSolid from 'rollup-preset-solid'
✗ import { withSolid } from 'rollup-preset-solid'
Exported as default, not named.
Options (type)
✓ import type { Options } from 'rollup-preset-solid'
✗ import { Options } from 'rollup-preset-solid'
Options is a TypeScript interface only; not runtime value.

Demonstrates minimal config with ESM and CJS outputs, plus hints for package.json fields.

// rollup.config.js import withSolid from 'rollup-preset-solid'; export default withSolid({ input: 'src/index.tsx', targets: ['esm', 'cjs'], printInstructions: true, });
Debug
Known issues
breakingIIFE builds now treat solid-js, solid-js/web, and solid-js/store as external by default.
fix
Either provide globals mapping or override external: [] to bundle them.
affects: >=3.0.0
deprecatedThe 'format' option is deprecated in favor of 'targets' array.
fix
Replace format: 'esm' with targets: ['esm'].
affects: >=2.0.0
gotchaIf you pass multiple configs (array), each entry must have its own input. Missing input causes build failure.
fix
Always specify input for each config object in array.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using CommonJS require() with ESM-only package.
fix
Switch to import syntax or set type: 'module' in package.json.
TypeError: withSolid is not a function
Named import instead of default import.
fix
Use default import: import withSolid from 'rollup-preset-solid'.
Module 'solid-js' is marked as external but no global mapping is provided
IIFE build with external modules but no globals.
fix
Provide globals option or override external to empty array.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
rolluprequiredRequired peer dependency for bundling
@rollup/plugin-typescriptoptionalImplicitly used for TypeScript compilation
Agent activity
12 hits · last 30 days
node
8
OpenAI (training)
1
Resources