How to remove global “use strict” added by babel

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

    just change .babelrc solution

    if you don't want to change any npm modules, you can use .babelrc ignore like this

    {
      "presets": ["es2015"],
      "ignore": [
        "./src/js/directive/datePicker.js"
      ]
    }
    

    ignore that file, it works for me!

    the ignored file that can't use 'use strict' is old code, and do not need to use babel to transform it!

提交回复
热议问题