javascript - Why do I get an error after using gulp to merge and compress multiple js files and then directly import them into the page?
巴扎黑2017-06-14 10:54:20
0
3
836
Why do I get an error after using gulp to merge and compress multiple js files and then directly introduce them into the page? There is no error before being compressed and packaged. What rules should be followed? ? ? Solve
The order of the src array is the order of the packaged code, so pay attention to the dependency relationship. For example, if a library depends on underscore, then the position of this library in the array must be after underscore. It is recommended to put the tool library at the front
There is no need to compress js files like jquery, you can just import them directly on the page. Usually you just need to compress the js and css that you hand-write
First try merging without compression to see if there is any problem, otherwise it is a matter of order
The order of the src array is the order of the packaged code, so pay attention to the dependency relationship. For example, if a library depends on underscore, then the position of this library in the array must be after underscore.
It is recommended to put the tool library at the front
There is no need to compress js files like jquery, you can just import them directly on the page.
Usually you just need to compress the js and css that you hand-write