API迁移
- 作者仓库星标 410
- 许可证 Complete terms in LICENSE.txt
- 作者更新于 实时读取
- 作者仓库 full-stack-skills
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @partme-ai · Complete terms in LICENSE.txt
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: rspack
description: Provides comprehensive guidance for Rspack bundler including configuration, plugins, loaders, op…
category: 工程开发
runtime: Node.js
---
# rspack 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“When to use this skill / How to use this skill / Inline Quick Start”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“When to use this skill / How to use this skill / Inline Quick Start”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“When to use this skill / How to use this skill / Inline Quick Start”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: rspack
description: Provides comprehensive guidance for Rspack bundler including configuration, plugins, loaders, op…
category: 工程开发
source: partme-ai/full-stack-skills
---
# rspack
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「When to use this skill / How to use this skill / Inline Quick Start」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "rspack" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> When to use this skill / How to use this skill / Inline Quick Start
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Node.js | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} When to use this skill
Use this skill whenever the user wants to:
- Set up Rspack in a new or existing project
- Configure Rspack for different environments
- Use built-in plugins or create custom plugins
- Migrate from Webpack to Rspack
- Optimize build performance
- Understand Rspack configuration options
- Use Rspack CLI or JavaScript API
- Write custom loaders
- Understand plugin API and hooks
- Configure entry points and output
- Set up code splitting and optimization
- Configure development server
- Handle assets and resources
- Use TypeScript with Rspack
- Troubleshoot Rspack issues
How to use this skill
This skill is organized to match the Rspack official documentation structure (https://rspack.rs/zh/guide/start/introduction, https://rspack.rs/zh/config/, https://rspack.rs/zh/plugins/, https://rspack.rs/zh/api/). When working with Rspack:
Identify the topic from the user's request:
- Getting started/快速上手 →
examples/guide/start/ - Configuration/配置 →
examples/config/ - Plugins/插件 →
examples/plugins/ - API →
examples/api/
- Getting started/快速上手 →
Load the appropriate example file from the
examples/directory:Guide (指南) -
examples/guide/:examples/guide/compatibility/plugin.mdexamples/guide/features/asset-base-path.mdexamples/guide/features/asset-module.mdexamples/guide/features/builtin-lightningcss-loader.mdexamples/guide/features/builtin-swc-loader.mdexamples/guide/features/dev-server.mdexamples/guide/features/esm.mdexamples/guide/features/layer.mdexamples/guide/features/lazy-compilation.mdexamples/guide/features/loader.mdexamples/guide/features/module-federation.mdexamples/guide/features/module-resolution.mdexamples/guide/features/plugin.mdexamples/guide/features/web-workers.mdexamples/guide/migration/cra.mdexamples/guide/migration/rspack_0.x.mdexamples/guide/migration/storybook.mdexamples/guide/migration/webpack.mdexamples/guide/optimization/analysis.mdexamples/guide/optimization/code-splitting.mdexamples/guide/optimization/lazy-barrel.mdexamples/guide/optimization/production.mdexamples/guide/optimization/profile.mdexamples/guide/optimization/tree-shaking.mdexamples/guide/optimization/use-rsdoctor.mdexamples/guide/start/ecosystem.mdexamples/guide/start/introduction.mdexamples/guide/start/quick-start.mdexamples/guide/tech/css.mdexamples/guide/tech/json.mdexamples/guide/tech/nestjs.mdexamples/guide/tech/next.mdexamples/guide/tech/preact.mdexamples/guide/tech/react.mdexamples/guide/tech/solid.mdexamples/guide/tech/svelte.mdexamples/guide/tech/typescript.mdexamples/guide/tech/vue.md
Configuration (配置) -
examples/config/:examples/config/cache.mdexamples/config/context.mdexamples/config/deprecated-options.mdexamples/config/dev-server.mdexamples/config/devtool.mdexamples/config/entry.mdexamples/config/experiments.mdexamples/config/extends.mdexamples/config/externals.mdexamples/config/filename-placeholders.mdexamples/config/index.mdexamples/config/infrastructure-logging.mdexamples/config/lazy-compilation.mdexamples/config/mode.mdexamples/config/module-rules.mdexamples/config/module.mdexamples/config/node.mdexamples/config/optimization-optimizationsplitchunks.mdexamples/config/optimization.mdexamples/config/other-options.mdexamples/config/output.mdexamples/config/performance.mdexamples/config/plugins.mdexamples/config/resolve-loader.mdexamples/config/resolve.mdexamples/config/stats.mdexamples/config/target.mdexamples/config/watch.md
Plugins (插件) -
examples/plugins/:examples/plugins/index.mdexamples/plugins/rspack/circular-dependency-rspack-plugin.mdexamples/plugins/rspack/copy-rspack-plugin.mdexamples/plugins/rspack/css-chunking-plugin.mdexamples/plugins/rspack/css-extract-rspack-plugin.mdexamples/plugins/rspack/esm-library-plugin.mdexamples/plugins/rspack/html-rspack-plugin.mdexamples/plugins/rspack/lightning-css-minimizer-rspack-plugin.mdexamples/plugins/rspack/subresource-integrity-plugin.mdexamples/plugins/rspack/swc-js-minimizer-rspack-plugin.mdexamples/plugins/rspack/virtual-modules-plugin.mdexamples/plugins/webpack/banner-plugin.mdexamples/plugins/webpack/case-sensitive-plugin.mdexamples/plugins/webpack/context-replacement-plugin.mdexamples/plugins/webpack/define-plugin.mdexamples/plugins/webpack/dll-plugin.mdexamples/plugins/webpack/dll-reference-plugin.mdexamples/plugins/webpack/electron-target-plugin.mdexamples/plugins/webpack/enable-chunk-loading-plugin.mdexamples/plugins/webpack/enable-library-plugin.mdexamples/plugins/webpack/enable-wasm-loading-plugin.mdexamples/plugins/webpack/entry-plugin.mdexamples/plugins/webpack/environment-plugin.mdexamples/plugins/webpack/eval-source-map-dev-tool-plugin.mdexamples/plugins/webpack/externals-plugin.mdexamples/plugins/webpack/hot-module-replacement-plugin.mdexamples/plugins/webpack/ignore-plugin.mdexamples/plugins/webpack/index.mdexamples/plugins/webpack/internal-plugins.mdexamples/plugins/webpack/javascript-modules-plugin.mdexamples/plugins/webpack/limit-chunk-count-plugin.mdexamples/plugins/webpack/module-federation-plugin-v1.mdexamples/plugins/webpack/module-federation-plugin.mdexamples/plugins/webpack/no-emit-on-errors-plugin.mdexamples/plugins/webpack/node-target-plugin.mdexamples/plugins/webpack/node-template-plugin.mdexamples/plugins/webpack/normal-module-replacement-plugin.mdexamples/plugins/webpack/progress-plugin.mdexamples/plugins/webpack/provide-plugin.mdexamples/plugins/webpack/runtime-chunk-plugin.mdexamples/plugins/webpack/source-map-dev-tool-plugin.mdexamples/plugins/webpack/split-chunks-plugin.md
API Reference -
examples/api/:examples/api/cli.mdexamples/api/index.mdexamples/api/javascript-api/browser.mdexamples/api/javascript-api/cache.mdexamples/api/javascript-api/compilation.mdexamples/api/javascript-api/compiler.mdexamples/api/javascript-api/index.mdexamples/api/javascript-api/logger.mdexamples/api/javascript-api/resolver.mdexamples/api/javascript-api/stats-json.mdexamples/api/javascript-api/stats.mdexamples/api/javascript-api/swc.mdexamples/api/loader-api/context.mdexamples/api/loader-api/index.mdexamples/api/loader-api/inline-match-resource.mdexamples/api/loader-api/inline.mdexamples/api/loader-api/writing-loaders.mdexamples/api/plugin-api/compilation-hooks.mdexamples/api/plugin-api/compiler-hooks.mdexamples/api/plugin-api/context-module-factory-hooks.mdexamples/api/plugin-api/index.mdexamples/api/plugin-api/javascript-modules-plugin-hooks.mdexamples/api/plugin-api/normal-module-factory-hooks.mdexamples/api/plugin-api/runtime-plugin-hooks.mdexamples/api/plugin-api/stats-hooks.mdexamples/api/runtime-api/hmr.mdexamples/api/runtime-api/module-methods.mdexamples/api/runtime-api/module-variables.md
Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Rspack is compatible with most Webpack plugins and loaders
- Configuration format is similar to Webpack
- Rspack provides better performance than Webpack
- Examples include both JavaScript and TypeScript versions
- Each example file includes parameters, returns, common errors, best practices, and scenarios
Reference the official documentation when needed:
- Guide: https://rspack.rs/zh/guide/
- Configuration: https://rspack.rs/zh/config/
- Plugins: https://rspack.rs/zh/plugins/
- API: https://rspack.rs/zh/api/
Inline Quick Start
# Create a new Rspack project
npm create rspack@latest
# Or add to existing project
npm install --save-dev @rspack/core @rspack/cli
// rspack.config.js
const { HtmlRspackPlugin } = require('@rspack/core');
module.exports = {
entry: './src/index.js',
output: {
filename: '[name].[contenthash].js',
clean: true,
},
module: {
rules: [
{
test: /\.jsx?$/,
use: {
loader: 'builtin:swc-loader',
options: { jsc: { parser: { syntax: 'ecmascript', jsx: true } } },
},
},
],
},
plugins: [new HtmlRspackPlugin({ template: './index.html' })],
optimization: { splitChunks: { chunks: 'all' } },
};
# Development
npx rspack serve
# Production build
npx rspack build
Best Practices
- Use TypeScript for configuration: Better type safety and autocomplete
- Leverage built-in plugins: Use Rspack plugins when available (faster than Webpack equivalents)
- Optimize for production: Use production mode for builds
- Code splitting: Use optimization.splitChunks for better performance
- Cache configuration: Enable persistent caching for faster rebuilds
- Use HMR: Enable Hot Module Replacement for better DX
Troubleshooting
- Webpack plugin not compatible: Check Rspack compatibility list; some Webpack plugins need Rspack equivalents
- Loader errors: Use
builtin:swc-loaderinstead ofbabel-loaderfor better performance - Build slower than expected: Enable persistent caching; check for unoptimized loaders
- Migration issues: Use the webpack migration guide at
examples/guide/migration/webpack.md
Resources
- Official Documentation: https://rspack.rs/zh/
- Getting Started: https://rspack.rs/zh/guide/start/introduction
- Configuration: https://rspack.rs/zh/config/
- Plugins: https://rspack.rs/zh/plugins/
- API Reference: https://rspack.rs/zh/api/
- GitHub Repository: https://github.com/web-infra-dev/rspack
Keywords
Rspack, rspack, bundler, webpack, rust, build tool, bundling, code splitting, HMR, hot module replacement, loader, plugin, configuration, entry, output, optimization, development server, 打包工具, 构建工具, 代码分割, 热模块替换, 加载器, 插件, 配置, 入口, 输出, 优化, 开发服务器
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核