JS - Can't combine lib files

混江龙づ霸主 提交于 2019-11-28 18:09:06

Most probably one of your js files is missing a ; at the end. Open up the one you believe is causing the error and add a ; at the end, or add a ; to the very first line of the next js file.

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.

just add semi-clone and newline

';\n'

at end of each file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!