This is a small demo that implements the following functions:
1. In the JS code to pack a lot of JS files, we need to control some individual JS pieces must be in front. Here is a simple implementation.
2. The implementation is merged into a JS file.
3. The implementation is compressed into one line, that is, generate *.min.js.
First, look at the directory structure
Wherein Main.js simulates the most important one JS file, on the page should first need to load the JS. File.
We put the files that do not need to consider the order in the JS folder. Main.js A.js b.js inside a few simple code. You can download the demo file to view.
Gulpfile.js
The Package.json file contains the plugin that the demo relies on.
Perform gulp tasks
Successful execution, below shows us the generated app.min.js file.
Demo file Baidu: Http://pan.baidu.com/s/1hswqNgo
Gulp Packing Compression JS code