JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2827
  • Score
    100M100P100Q131981F
  • License MIT

Preset for building your SolidJS package with tsup.

Package Exports

  • tsup-preset-solid
  • tsup-preset-solid/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tsup-preset-solid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tsup-preset-solid

tsup-preset-solid

pnpm npm downloads

Preset for building your SolidJS packages with ease using tsup (powered by esbuild).

Features

  • Preconfigured - Just install, set your entries and use it.

  • Fast - Uses esbuild under the hood.

  • SolidStart support - Includes solid export condition with preserved JSX.

  • Best practices - Ensures that the built library works well with Solid's tooling ecosystem.

  • Development and server entries - Creates a separate entry for development, server-side rendering and production form a single source.

  • Multiple entries - Supports multiple package entries. (submodules)

  • Automatic package.json configuration - Automatically writes export fields to package.json based on passed options.

Warning This is a very fresh project, so diverging from the happy path may cause unexpected results. Please report any issues you find.

Quick start

Install it:

npm i -D tsup tsup-preset-solid
# or
pnpm add -D tsup tsup-preset-solid

Add it to your tsup.config.ts

// tsup.config.ts
import { defineConfig } from 'tsup-preset-solid'

export default defineConfig(
  // entries (array or single object)
  [
    // first entry in array should be the main one (index)
    {
      // entries with '.tsx' extension will have `solid` export condition generated
      entry: 'src/index.tsx',
      // Setting `true` will generate a development-only entry
      devEntry: true,
      // Setting `true` will generate a server-only entry
      serverEntry: true,
      // Setting `true` will remove all `console.*` calls and `debugger` statements
      dropConsole: true,
      // Format is ['esm', 'cjs'] by default
      foramt: 'esm',
    },
    {
      entry: 'src/additional.ts',
    },
  ],
  // additional options
  {
    // Setting `true` will console.log the package.json fields
    printInstructions: true,
    // Setting `true` will write export fields to package.json
    writePackageJson: true,
  },
)

Add scripts to your package.json

{
  "scripts": {
    "build": "tsup",
    "dev": "tsup --watch"
  }
}