📜  parcel (1)

📅  最后修改于: 2023-12-03 14:45:05.213000             🧑  作者: Mango

Parcel

Parcel is a web application bundler that is fast, zero configuration and supports multiple file types out of the box. With Parcel, you can create and bundle any kind of web projects, from simple static websites to complex web applications.

Features
  • Zero configuration: Just install Parcel and start bundling, it will automatically detect your entry file and produce a production-ready build.
  • Fast: Parcel uses multicore processing to bundle your code, making it fast even for big projects.
  • Supports multiple file types: Parcel supports a variety of file types out of the box, including JavaScript, CSS, HTML, images, and fonts.
  • Hot module replacement: Parcel has built-in support for hot module replacement, meaning your changes will appear instantly in the browser without the need for a full page reload.
  • Code splitting: Parcel automatically detects and splits your code into smaller chunks, improving your application's load time.
  • Plugins: Parcel has a plugin system that allows you to customize and extend its behavior. There are already many plugins available, including ones for TypeScript, React, Vue, and more.
Getting Started

To use Parcel, simply install it using npm:

npm install -g parcel-bundler

Then create an HTML file and add a script tag pointing to your entry file:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>My App</title>
</head>
<body>
  <script src="./index.js"></script>
</body>
</html>

Finally, run Parcel using your entry file as the input:

parcel index.html

Parcel will automatically detect your entry file and produce a production-ready build in the dist directory.

Conclusion

Parcel is an excellent choice for web developers who want a fast and easy-to-use bundler. With its zero configuration and great features, Parcel makes it easy to create and bundle any kind of web projects. Try it out and see for yourself!