2015-06-01 29 views
3

我升级了我的Elixir和Gulp,现在我可以看到我的一些混合脚本已损坏。Laravel Elixir升级后使用严格添加到每个文件 - 破坏脚本

当我点击gulpgulp --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

感谢您的帮助。

回答

2

这是众所周知的问题,事实上杰弗里要求反馈人们如何解决这个问题,你可以找到更多的信息here并给出你的意见。

而且quoting Jeffrey Way上一个可能的解决方案:

We have two options:

  1. You may disable Babel support, if you don't desire it. elixir.config.babel.enabled = false.
  2. We can blacklist "useStrict", so that it doesn't get included. Not sure we should do this, but it's an option.
+0

是啊,这就是他回答我说:https://laracasts.com/discuss/channels/elixir/broken-mix-after-elixir-update – slick