Home >Java >javaTutorial >Detailed introduction to webpack in java

Detailed introduction to webpack in java

零下一度
零下一度Original
2017-06-30 11:21:452131browse

1.what webpack ?

Webpack is a module packager. It will perform static analysis based on module dependencies, and then generate corresponding static resources for these modules according to specified rules.

2.webpack installation.

Note: Webpack needs to be installed in the node environment, but webpack requires Node.jsv0.6 or above.

Install webpack through npm on the command line:

$ npm install webpack -g     
//相当于在全局情况下安装了webpack

You can check the version through webpack -h

3. Webpack currently has two main versions , one is the stable version of the master trunk, and the other is the beta version of the webpack-2 branch. The beta version has some experimental features and is incompatible with the stable version.

4. Use

1. First you need to introduce

 

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

Create the js entry file enter.js

pico anter.js
//在编译器中输入
document.write(&#39;It working&#39;);
//保存退出

Compile enter.js and package it into bundle.js

Execute $webpack ./enter.js bundle.js

Learned this today

The above is the detailed content of Detailed introduction to webpack in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn