How to remove global “use strict” added by babel

后端 未结 16 2272
不思量自难忘°
不思量自难忘° 2020-11-27 03:46

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 \"us

16条回答
  •  情深已故
    2020-11-27 04:17

    Using plugins or disabling modules and strict mode as suggested in the @rcode's answer didn't work for me.

    But, changing the target from es2015|es6 to es5 in tsconfig.json file as suggested by @andrefarzart in this GitHub answer fixed the issue.

    // tsconfig.json file
    {
      // ...
      "compilerOptions": {
        // ...
        "target": "es5", // instead of "es2015"
    }
    

提交回复
热议问题