parcel
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseParcel
Parcel
Parcel is the "Zero Config" bundler. It works out of the box for React, Vue, Rust (Wasm), and more. v2.12 uses Lightning CSS for extreme performance.
Parcel 是一款“零配置”打包工具。它开箱即可支持 React、Vue、Rust (Wasm) 等多种技术栈。v2.12 版本采用 Lightning CSS 以实现极致性能。
When to Use
适用场景
- Prototypes: You just want to work.
index.html - Simple Apps: You don't want to maintain a 500-line config file.
- Polyglot: You have images, Rust, and SCSS mixed together.
- 原型开发:你只希望 能直接运行。
index.html - 简单应用:你不想维护长达500行的配置文件。
- 多语言混合项目:你的项目中混合了图片、Rust 和 SCSS 等多种资源。
Core Concepts
核心特性
Zero Config
零配置
It auto-detects transforms. If you , it installs automatically.
import './style.scss'sass它会自动检测转换需求。如果你使用 ,它会自动安装 插件。
import './style.scss'sassCaching
缓存机制
Aggressive filesystem caching makes restarts instant.
激进的文件系统缓存让重启瞬间完成。
Workers
多线程处理
Parallelizes work across all cores.
利用所有核心 CPU 并行处理任务。
Best Practices (2025)
2025年最佳实践
Do:
- Use : Point Parcel at your HTML file as the entry.
<script type="module"> - Use : Parcel supports build-time macros.
macros
Don't:
- Don't fight the auto-install: Let Parcel manage its plugins.
推荐做法:
- 使用 :将 HTML 文件作为 Parcel 的入口文件。
<script type="module"> - 使用 :Parcel 支持构建时宏。
macros
不推荐做法:
- 不要抗拒自动安装:让 Parcel 管理其插件。