Rslib features track
CLI
- [x] Support
npm create rslib@latestto create a Rslib project - [x] Support
--inspectto show Rslib/Rsbuild/Rspack config - [x] #138
- [ ] Add some debug info to better debugging Rslib
Config
- [x] 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
- [x] basic support
format
- [x] cjs
- [x] esm
- [x] umd
- [x] mf
platform
- [x] support output.target
- [x] support control the syntax target for downgration
alias
- [x] use source.alias
autoExtension
- [x] js extension
- [x]
.jswith esm format and.cjswith cjs format whentype: module - [x]
.jswith cjs format and.mjswith esm format whentype: commonjs
- [x]
- [x] dts extension
- [x]
.d.tswith esm format and.d.ctswith cjs format whentype: module - [x]
.d.tswith cjs format and.d.mtswith esm format whentype: commonjs
- [x]
externals
- [x] prevent externalizing entry modules in bundleless mode
- [x] make node built-in modules external when target is node
- [x] support auto external dependencies and peerDependencies
- [x] support tools.swc to external helpers
redirect
- [x] redirect in js outputs of bundleless mode
- [x] path
- [x] extension (import/export)
- [x] style
- [x] asset path
- [x] redirect in DTS outputs of bundleless mode
- [x] path
- [x] extension
shims
- [x] shims
__filenameand__dirnamein esm - [x] shims
import.meta.urlin cjs - [x] set
module.parser.javascript.importMeta = falsein esm
banner & footer
- [x] integrate banner-plugin to inject content
- [x] support inject in dts files
dts
- [x] support
cleanDistPathto clean DTS output before emit - [x] use ts compiler API to generate bundleless dts
- [x] watch api in watch mode
- [x] incremental build with project reference
- [x] use api-extractor to generate dts bundle
- [x] auto external packages
- [x] optimize log output and error handler
- [x] support autoExtension for dts files
- [x] support
abortOnErroroption to control whether to exit process when dts build error - [ ] support generate dts when isolatedDeclarations enabled
css
- [x] less support @rsbuild/plugin-less
- [x] sass support @rsbuild/plugin-sass
- [x] css modules output.cssModules
- [x] postcss tools.postcss
- [x] tailwind css using tailwind CSS
- [x] style inject output.injectStyles
Module Federation
- [x] https://github.com/web-infra-dev/rslib/issues/212
input
- [x] use source.entry
copy
- [x] use output.copy
define
- [x] use source.define
minify
- [x] use output.minify
outDir
- [x] use output.distPath
resolve
- [x] use resolve
sourcemap
- [x] use output.sourcemap
transformImport
- [x] use source.transformImport
decorators
- [x] use source.decorators
asset
- [x] asset import / export in outputs
- [x] name: output.filename
- [x] limit: output.dataUriLimit
- [x] path: output.distPath
- [x] publicPath: output.assetPrefix
- [x] svgr: @rsbuild/plugin-svgr
polyfill
- [x] node polyfill
- [x] polyfill with core-js-pure
prebundle
- [ ] like what ncc do
Ecosystem
- [x] 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
- [x] Vue component support
Advanced
- [ ] JS API
- [ ] Zero-config use
- [ ] Config check
- [x] package.json, like publint
- [ ] tsconfig.json
- [ ] types, like Are the types wrong?
Migration
- [x] Config map between Rslib and Modern.js Module
- [x] 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
Usually this kind of tools need extends options, don't you think?
Usually this kind of tools need
extendsoptions, don't you think?
Can you give some examples of what extends is going to do?
突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!
另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档 😂
功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。
@lanmingle
突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!
Thank you for your dogfooding, we will release the first stable version 0.1.0 in the end of year.
另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档 😂
Rslib documentation is still under construction, stay tuned for a stable version and we will translate the Chinese document after the English document is completed.
功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。
You can open an issue in https://github.com/rspack-contrib/create-rstack.
You can open an issue in https://github.com/rspack-contrib/create-rstack.
create-rslib already provides some CLI flags, see: https://lib.rsbuild.dev/guide/start/quick-start#quick-creation
突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!
Thank you for your dogfooding, we will release the first stable version 0.1.0 in the end of year.
另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档 😂
Rslib documentation is still under construction, stay tuned for a stable version and we will translate the Chinese document after the English document is completed.
功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。
You can open an issue in https://github.com/rspack-contrib/create-rstack.
https://github.com/rspack-contrib/create-rstack/issues/21
Please also consider support for svelte components