How to remove global “use strict” added by babel
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using function form of "use strict" and don't want global form which Babel adds after transpilation. The problem is I'm using some libraries that aren't using "use strict" mode and it might throw error after scripts are concatenated 回答1: Babel 5 You'd blacklist "useStrict" . For instance here's an example in a Gruntfile: babel : { options : { blacklist : [ "useStrict" ], // ... }, // ... } Babel 6 Since Babel 6 is fully opt-in for plugins now , instead of blacklisting useStrict , you just don't include the strict-mode plugin .