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 ---