"Webpack" Help document translation: Webpack module

Source: Internet
Author: User

Page from Webpack Official document (when composing, is v4.1.1)

In fact, Webpack itself has Chinese documents, do not know who to write, but their own translation once feel better understanding.

https://webpack.js.org/concepts/modules/

Module

In modular programming, developers split the code of individual functions into modules.

Each module volume is smaller than a large lump of the program, making debugging and writing easier.

NODEJS has supported modular programming since its inception, but in Web programming, modularity has been slow (not supported), and of course there are many JS modular tools for modularity that have advantages and disadvantages.

Webpack refine, inheriting their excellent place, makes modularity suitable for any file in a Web project.

What is the Webpack module

Unlike the Nodejs single, Webpack can be used in a variety of ways to accomplish modular programming:

    • Import expression of ES6
    • require () Expression of COMMONJS
    • Define and require representations of AMD (asynchronous module definition)
    • @import Expressions in css/sass/less files
    • Image URL address in a style sheet or HTML file (unknown?) )

The Webpack 1 generation needs a specific loader to complete the import representation of ES6, but Webpack 2 is natively supported.

Supported Module types

Webpack supports loading various types of modules with the loader, which tells Webpack what these modules are (because it is not a JavaScript module) and then packs them together.

Types of support include:

    • Coffeescript
    • TypeScript
    • Esnext (Babel)
    • Sass
    • Less
    • Stylus

Wait a minute. Webpack supports many kinds of modular packaging for Web programming, making web development easier for developers.

The full list of loaders is as follows: Point me

"Webpack" Help document translation: Webpack module

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.