search

Home  >  Q&A  >  body text

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?


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

巴扎黑巴扎黑2712 days ago810

reply all(3)I'll reply

  • 黄舟

    黄舟2017-06-14 10:56:20

    First try merging without compression to see if there is any problem, otherwise it is a matter of order

    reply
    0
  • PHP中文网

    PHP中文网2017-06-14 10:56:20

    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

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-14 10:56:20

    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

    reply
    0
  • Cancelreply