Webpack, webpack tutorial

Source: Internet
Author: User
Tags webpack tutorial

Webpack, webpack tutorial

--- Restore content start ---

1. what webpack?

Webpack is a module package. It performs Static Analysis Based on the dependencies of the modules, and then generates the corresponding static resources based on the specified rules.

2. Install webpack.

Note: You need to install webpack in the node environment, but webpack must be Node. jsv0.6 or later.

Install webpack through npm in the command line:

$ Npm install webpack-g // equivalent to installing webpack globally

You can use webpack-h to check the version.

3. webpack currently has two main versions, one is the stable version of the master, one is the beta version of the webpack-2 branch has some experimental features and is not compatible with the stable version.

4. Use

1. First introduce

  

<body>          <script src="bundle.js"></script></body>

Create the js entry file enter. js

Pico anter. js // input document. write ('It working') in the compiler; // save and exit

Compile enter. js and package it into bundle. js

Run $ webpack./enter. js bundle. js

I learned this today

 

--- Restore content end ---

Related Article

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.