Why webpack!

Why webpack?
 
In fact, today many pages can be seen as a feature-rich application that has a lot of complex JavaScript code and dependencies.
The modular, so that we can refine the complex procedures for the smaller file;
 
This expansion is similar to TypeScript developed on the basis of the JavaScript language: so that we can achieve characteristics of the current version of JavaScript can not be used directly, and then can be converted to JavaScript file so that the browser can be identified;
Scss, less like CSS preprocessor;
 
These improvements did greatly improve the efficiency of development, but developers often use the files they need additional treatment to be recognized by the browser, but also a very tedious manual processing, which provides the requirements for the emergence of webpack these tools.
 
webpack is a module packer, he can analyze your project structure, find the JavaScript module and some other files can not be directly recognized browser, such as typescript, less, scss, etc., and then they converted and packaged into a suitable format for the browser use.
 
webpack work and grunt Gulp difference /:
 
Gulp and grunt work is: in a configuration file, specify the file for some specific steps similar compilation, combination, compression and other tasks, these tasks can be done automatically for you after tool
 
webpack works is: put your project as a whole, by a given master file index.js, webpack from this document to find all dependent files in the project, using the loader handling them, and finally packaged as one or more browsers JavaScript files can be identified
 
webpack, gulp / grunt, npm package aspects What is the difference:
 
1.webpack is a packer module, all modules packaged into one or a few files, so that you only need to load a few files which can run applications
 
2.gulp / grunt automated build tools that can not be packaged modules, plug-rich than webpack
 
3.npm package manager is a node, node management for third-party software packages, npm biggest advantage is the task of command, just enough to complete a few tasks command module package all your needs and build automation.

Guess you like

Origin www.cnblogs.com/AmyLin-blogs/p/11453536.html