rspack
npx skills add https://github.com/partme-ai/full-stack-skills --skill rspack
Agent 安装分布
Skill 文档
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/
Best Practices
- Use TypeScript for configuration: Better type safety and autocomplete
- Leverage built-in plugins: Use Rspack plugins when available
- 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
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, æå å·¥å ·, æå»ºå·¥å ·, 代ç åå², çæ¨¡åæ¿æ¢, å è½½å¨, æä»¶, é ç½®, å ¥å£, è¾åº, ä¼å, å¼åæå¡å¨