Skip to content

docs: add a guide for building a Solid library - #450

Open
lxsmnsyc wants to merge 1 commit into
mainfrom
docs/97-library-guide-main
Open

lxsmnsyc wants to merge 1 commit into
mainfrom
docs/97-library-guide-main

Conversation

@lxsmnsyc

Copy link
Copy Markdown
Member

Fixes #97 on main (1.x). The guide for next is in a separate PR.

Adds a "Building a library" section to the README.

What it covers

  • Why a library ships its JSX source under a solid export condition.
  • An exports map with types, solid and import entries, and the peer dependencies.
  • Building the source and .d.ts files with tsc and jsx: preserve.
  • Building compiled output with Vite library mode, with the Solid packages marked external.
  • How CSS is handled.
  • Using the library from an app or a monorepo package.

Testing

Built a small library with this guide and used it from an app with this branch's plugin.

  • The app resolves the library to its JSX source on the client and in SSR.
  • SSR output includes hydration keys, and the client bundle includes the library's code and CSS.
  • Without the solid condition, SSR throws Client-only API called on the server side, as the guide says.

🤖 Generated with Claude Code

- Add a "Building a library" section to the README.
- It covers the `solid` export condition, the package.json `exports` map,
  JSX source and types with `tsc`, compiled output with Vite library mode,
  CSS, and using the library from an app or a monorepo package.

Closes #97

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0d88bb0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite-plugin-solid@450

commit: 0d88bb0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to build a library for SolidJS

1 participant