协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
rslib-best-practices【开发与工程】Configure, review, or troubleshoot Rslib library builds, output formats, declarations, dependency handling, and integrations.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Apply these rules when writing or reviewing Rslib library projects.
rslib.config.ts and defineConfiglib.*), and also leverage Rsbuild configurations (e.g., source.*, output.*, tools.*) as neededtools.rspack or tools.bundlerChain to access Rspack's native configurationstsconfig.json path aliasesrslib to buildrslib --watch to build in watch mode for local developmentrslib inspect to inspect final Rslib/Rsbuild/Rspack configs"type": "module" in package.jsonoutput.target set to 'web' when building component librariesexports field in package.json is correctly configured and matches the actual JavaScript output and declaration files output of different formats (ESM, CJS, etc.)lib.dts: true or detailed configurationslib.dts.tsgo experimental feature with @typescript/native-preview installeddevDependencies in bundle mode and dependencies in dependencies and peerDependencies will be automatically externalized (not bundled) by defaultpackage.json carefully to ensure no missing dependency errors occur when consumers install and use this packagelib.syntax aligned with real compatibility requirements to enable better optimizations@rstest/adapter-rslib for writing tests@rspress/plugin-preview and @rspress/plugin-api-docgen for component previews and API docsDEBUG=rsbuild when diagnosing config resolution or plugin behaviordist/.rsbuild to confirm final Rsbuild/Rspack config, not assumed config