我看了很多帖子,但还是没能做到:(
我有。宝贝
{ "comments": false, "presets": [ ["@babel/env", { "targets": { "browsers": ["ios 7"] } }], ["minify"] ] }
我想告诉巴贝尔 添加 "use strict" (任何地方)
"use strict"
这是怎么做到的?
默认情况下,Babel假设正在转换的文件是ES模块。既然你不是这样的,你就要告诉它。你可以退房 the docs for the "sourceType" option ,但基本上您需要添加:
"sourceType"
"sourceType": "script"
在你的巴别塔选择。