Open
Description
CLI
- Support
npm create rslib@latest
to create a Rslib project - Support
--inspect
to show Rslib/Rsbuild/Rspack config - [Feature]: Support watch
rslib.config
to rebuild #138 - Add some debug info to better debugging Rslib
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
- cjs
- esm
- umd
- mf
platform
- support output.target
- support control the syntax target for downgration
alias
- use source.alias
autoExtension
- js extension
-
.js
with esm format and.cjs
with cjs format whentype: module
-
.js
with cjs format and.mjs
with esm format whentype: commonjs
-
- dts extension
-
.d.ts
with esm format and.d.cts
with cjs format whentype: module
-
.d.ts
with cjs format and.d.mts
with esm format whentype: commonjs
-
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
- less support @rsbuild/plugin-less
- sass support @rsbuild/plugin-sass
- css modules output.cssModules
- postcss tools.postcss
- tailwind css using tailwind CSS
- style inject output.injectStyles
Module Federation
input
- use source.entry
copy
- use output.copy
define
- use source.define
minify
- use output.minify
outDir
- use output.distPath
resolve
- use resolve
sourcemap
- use output.sourcemap
transformImport
decorators
asset
- asset import / export in outputs
- name: output.filename
- limit: output.dataUriLimit
- path: output.distPath
- publicPath: output.assetPrefix
- svgr: @rsbuild/plugin-svgr
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
- JS API
- Zero-config use
- Config check
- package.json, like publint
- tsconfig.json
- types, like Are the types wrong?
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
Labels
No labels