JS - Can't combine lib files

后端 未结 3 487

I have multiple lib files in an an index.html file, that are loaded in proper sequence for an app I am running.


<         


        
3条回答
  •  眼角桃花
    2020-12-13 13:21

    Modifying the javascript code is not fixing the root cause of the problem so this could happen again as soon as you introduce a new JavaScript file.

    You have at least few choices for a permanent fix - they involve changing the build so that this cannot happen in the future, even if a semi-colon is missing:

    • Inject a ; between the files you are concatenating. This is usually a simple one-line change depending on how you are concatenating the files.
    • Minify the files first and then concatenate. This should leave a \n between the files you are concatenating, allowing ASI to take care of this for you.

提交回复
热议问题