Parcel 中文文档
快速入门
了解如何创建一个新项目,或者将现有的项目迁移到 Parcel 2。
用 Parcel 构建 web 应用程序
了解如何使用 Parcel 从零开始设置一个全新的 web 应用程序。
使用 Parcel 构建工具库
了解如何设置 Parcel 来构建 JavaScript 工具库。
版本升级
将现有的项目从 Parcel 1 升级到 Parcel 2。
功能
了解 Parcel 的核心功能。
开发
了解 Parcel 的开发服务器(dev server)、热重载(hot reloading)、延迟模式(lazy mode)、缓存(caching)等功能。
代码拆分
如何使用动态导入(dynamic imports)和 Parcel 的 automatic shared bundles。
解析
如何解析依赖项、url 模式(url schemes)、别名(aliases)等。
Bundle Inlining
How to inline the compiled contents of one bundle inside another.
编译目标
如何为多个目标环境编译源码。
生产环境
缩减(Minification)、tree shaking、压缩(compression)、内容指纹(content hashing)等。
Scope hoisting
Dig into the details of how Parcel's tree shaking implementation works.
Node emulation
Using Node.js features like environment variables and builtin module polyfills.
CLI
A reference for all of the options available in the Parcel CLI.
Parcel API
Run Parcel builds programmatically to integrate into any build.
Plugins
Overriding and extending Parcel's defaults using plugins.
Languages and Frameworks
Learn how to use the most common languages and frameworks with Parcel. See the side navigation for even more.
HTML
The entry of most Parcel apps. From here, you can reference scripts, styles, images, and more.
JavaScript
Using ES modules and CommonJS, setting up transpilation, JSX, workers, and more.
CSS
Using CSS with Parcel, including dependencies, CSS modules, PostCSS, and more.
SVG
Referencing SVG from HTML, CSS, JavaScript, and JSX, including scripts and styles, and more.
TypeScript
Using TypeScript with Parcel, including transpilation and generating typings.
Images
Resizing, converting, and optimizing images.
React
Using React with Parcel, including Fast Refresh, styling, images, code splitting, and more.
Vue
Using Vue 3 SFCs with Parcel.
Plugin System
Learn how to customize and extend Parcel's defaults with your own plugins.
Concepts
Plugin System
An overview of Parcel's architecture and core data structures.
Authoring Plugins
An introduction to Parcel's Plugin APIs, and a guide to publishing a plugin package.
Diagnostics
How to emit errors and logs using Parcel's unified diagnostics format.
Source Maps
How to work with Parcel's source maps library in your plugin.
Plugin Types
Transformer
Compile individual source files and extract dependencies.
Resolver
Resolve a dependency to a file path or virtual module.
Namer
Determine the name of an output file.
Packager
Combine multiple assets together into a single output file.
Optimizer
Minify, optimize, and transform output files.
Compressor
Compress and encode output files in multiple formats.
Reporter
Receive events on build progress and completion.
Configuration
Share Parcel configuration between projects.