python模块捆绑器组件
As developers, we love to build parts of our application as modules, being that modules help to improve, especially the reusability of code. So, writing or importing modules into an existing or a new web application is almost inevitable. To make the workflow as seamless as possible we also make use of bundlers to compile file assets.
作为开发人员,我们喜欢将应用程序的一部分构建为模块,因为模块有助于改善,尤其是代码的可重用性。 因此,将模块写入或导入到现有或新的Web应用程序中几乎是不可避免的。 为了使工作流程尽可能无缝,我们还使用捆绑程序来编译文件资产。
Despite having numerous bundlers that carry out practically the same functionality but different and separate modes of configuration, I will like to present to you in this article, a new JavaScript bundler called Parcel.
尽管有许多捆绑器实际上执行相同的功能,但配置方式不同且不同,但我还是希望在本文中为您提供一个名为Parcel的新JavaScript捆绑器。
什么是包裹,为什么要使用? ( What is Parcel and Why Use It? )
Parcel is an asset bundler for modern applications. It offers a blazing fast compilation time and zero configuration. Simply put, parcel allows simplicity in compiling file assets. Out of the box, parcel can be used on a large code base or just a very basic application that requires compilation of file assets.
包裹是用于现代应用程序的资产捆绑器。 它提供了惊人的快速编译时间和零配置。 简而言之,宗地可以简化文件资产的编译。 开箱即用的包裹可以用于大型代码库,也可以仅用于需要编译文件资产的非常基本的应用程序。
According to the creator of Parcel, the intention was to solve two main problems with existing popular module bundlers like Browserify and Webpack: performance and hassles during configuration. With Parcel you can easily load modules with either commonJS and ES6 module syntax, as we will see later in this article.
根据Parcel的创建者,其目的是解决现有流行的模块捆绑器(例如Browserify和Webpack)的两个主要问题: 配置过程中的 性能和麻烦 。 使用Parcel,您可以轻松地使用commonJS和ES6模块语法加载模块,正如我们将在本文后面看到的那样。
With Over 12,000 stars already on Github. Parcel has surely gained a lot of attention from the community.
Github上已有超过12,000个星星。 包裹肯定引起了社区的广泛关注。
Some of the features include:
一些功能包括:
- Blazing fast bundling 炽烈的快速捆绑
- Out of the box support for css, js, HTML, images, file assets and no need to install plugins to carry out all this 开箱即用的对CSS,JS,HTML,图像,文件资产的支持,无需安装插件即可完成所有这些工作
- A built in development server. 内置的开发服务器。
包裹基准 (Benchmark by Parcel)
我们将学到什么 ( What we will learn )
In this article, I am going to show you how to set up parcel, how to create modules and how to use it with existing npm modules, sass and some other stuffs with very minimal or no configuration at all. Ready? let’s get to work!
在本文中,我将向您展示如何设置宗地,如何创建模块以及如何将其与现有的npm模块,sass和一些其他东西一起使用,而这些东西很少或根本没有任何配置。 准备? 让我们开始工作吧!
入门 ( Getting Started )
Getting started and setting up Parcel is incredibly s