Skip to content

Rslib features track #46

Open
Open
@Timeless0911

Description

@Timeless0911

CLI

Config

  • Provide preset templates to default set some common configs for basic scenes
  • Support better shared Rsbuild config

Features

We try to keep the features aligned with Modern.js Module

bundle / bundleless

  • basic support

format

output.library.type

  • cjs
  • esm
  • umd
  • mf

platform

  • support output.target
  • support control the syntax target for downgration

alias

autoExtension

  • js extension
    • .js with esm format and .cjs with cjs format when type: module
    • .js with cjs format and .mjs with esm format when type: commonjs
  • dts extension
    • .d.ts with esm format and .d.cts with cjs format when type: module
    • .d.ts with cjs format and .d.mts with esm format when type: commonjs

externals

output.externals

  • prevent externalizing entry modules in bundleless mode
  • make node built-in modules external when target is node
  • support auto external dependencies and peerDependencies
  • support tools.swc to external helpers

redirect

  • redirect in js outputs of bundleless mode
    • path
    • extension (import/export)
    • style
    • asset path
  • redirect in DTS outputs of bundleless mode
    • path
    • extension

shims

  • shims __filename and __dirname in esm
  • shims import.meta.url in cjs
  • set module.parser.javascript.importMeta = false in esm

banner & footer

  • integrate banner-plugin to inject content
  • support inject in dts files

dts

  • support cleanDistPath to clean DTS output before emit
  • use ts compiler API to generate bundleless dts
    • watch api in watch mode
    • incremental build with project reference
  • use api-extractor to generate dts bundle
    • auto external packages
  • optimize log output and error handler
  • support autoExtension for dts files
  • support abortOnError option to control whether to exit process when dts build error
  • support generate dts when isolatedDeclarations enabled

css

Module Federation

input

copy

define

minify

outDir

resolve

sourcemap

transformImport

decorators

asset

polyfill

  • node polyfill
  • polyfill with core-js-pure

prebundle

  • like what ncc do

Ecosystem

  • Storybook integration
  • Support using Rspress to build a static site for module doc
  • Monorepo development with fast one-time HMR
  • Simple bump and publish workflow
  • Vue component support

Advanced

Migration

  • Config map between Rslib and Modern.js Module
  • Migrate E2E test cases from Modern.js Module
  • performance benchmark with other tools
  • Adding integration tests about using Rsbuild to bundle packages built by Rslib

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions