How to remove global “use strict” added by babel

后端 未结 16 2271
不思量自难忘°
不思量自难忘° 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:22

    You can tell babel that your code is a script with:

    sourceType: "script"
    

    This will not add use strict. See sourceType option docs

    Source: https://github.com/babel/babel/issues/7910#issuecomment-388517631

提交回复
热议问题