npm.io
0.22.0 • Published 5d ago

@savvy-web/rslib-builder

Licence
MIT
Version
0.22.0
Deps
19
Size
366 kB
Vulns
0
Weekly
88
DeprecatedThis package is deprecated

@savvy-web/rslib-builder

This package is deprecated and no longer maintained. All functionality has been moved to our new bundler @savvy-web/bundler Sources live in the Silk Suite monorepo. No further releases, fixes, or security patches will be published here.

npm version License: MIT Node.js Version

Build modern ESM Node.js libraries with minimal configuration. Handles TypeScript declarations, package.json transformations, and PNPM workspace resolution automatically.

Features

  • Zero-Config Entry Detection - Auto-discovers entry points from package.json exports
  • 10-100x Faster Types - Uses tsgo (native TypeScript compiler) with API Extractor for bundled, clean public API declarations
  • Production-Ready Transforms - Converts .ts exports to .js, resolves PNPM catalog: and workspace: references, generates files array
  • Bundled or Bundleless - Choose single-file bundles per entry or bundleless mode that preserves your source file structure
  • RSPress Plugin Builder - Dedicated builder for RSPress plugins with dual-bundle architecture (plugin + runtime) and React support
  • Multi-Target Builds - Separate dev (with source maps) and npm (optimized) outputs from a single configuration
  • Flexible Formats - ESM, CJS, or dual format output with per-entry format overrides
  • TSDoc Validation - Pre-build documentation validation with automatic public API discovery

Installation

npm install --save-dev @savvy-web/rslib-builder @rslib/core @typescript/native-preview

Quick Start

// rslib.config.ts
import { NodeLibraryBuilder } from '@savvy-web/rslib-builder';

export default NodeLibraryBuilder.create({
  externals: ['@rslib/core'],
});

Build with rslib build --env-mode dev or rslib build --env-mode npm.

RSPress Plugins

Build RSPress plugins with zero-config dual-bundle output (plugin + runtime):

// rslib.config.ts
import { RSPressPluginBuilder } from '@savvy-web/rslib-builder';

export default RSPressPluginBuilder.create({
  plugin: {
    externals: ['typescript', 'shiki'],
  },
  runtime: {
    externals: ['@rspress/plugin-llms'],
  },
});

RSPressPluginBuilder auto-detects the runtime entry at src/runtime/index.tsx, handles React JSX compilation, CSS modules, and built-in RSPress externals. For advanced configuration, see RSPress Plugin Setup.

Documentation

For configuration options, API reference, and advanced usage, see docs.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Keywords