我升级了我的 Elixir 和 Gulp,现在我可以看到我的一些混合脚本已损坏。
当我点击 gulp
或 gulp --production
时,一切似乎都已编译、混合和版本化。问题直接在页面上。脚本在控制台中抛出异常。
现在有两个损坏的脚本 moment.js
和 bootstrap datetimepicker
。
Uncaught TypeError: Cannot set property 'moment' of undefined(anonymous function) @ common-1e3de0f4.js:1(anonymous function) @ common-1e3de0f4.js:1 create:207
Uncaught TypeError: $(...).datetimepicker is not a function
这一定与我执行 npm 更新这一事实有关,因为我所有的自定义脚本都很好——只是这些插件坏了——而我没有碰过它们。
我看到现在每个文件前面都有'use strict';以前从未发生过。
我真的很想自己解决,但我不知道从哪里开始寻找解决方案。
我的 gulpfile.js http://pastebin.com/NQ8f9tGr
感谢您的帮助。
最佳答案
这是一个已知问题,事实上 Jeffrey 正在征求反馈,人们希望如何解决这个问题,您可以找到更多信息 here并给出你的意见。
还有 quoting Jeffrey Way关于可能的解决方案:
We have two options:
- You may disable Babel support, if you don't desire it. elixir.config.babel.enabled = false.
- We can blacklist "useStrict", so that it doesn't get included. Not sure we should do this, but it's an option.
关于javascript - 在 Laravel Elixir 升级后使用严格添加到每个文件 - 损坏的脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30571628/