Babel 6 react JSX transformer - disable strict

后端 未结 2 666
甜味超标
甜味超标 2021-01-04 02:45

Issue

I\'m using babel 6 for react JSX transforms. However I\'m not using the react preset, I am ONLY using the \'transform-react-jsx\' plugin (and trying strict-m

2条回答
  •  死守一世寂寞
    2021-01-04 03:11

    transform-strict-mode is used only to include the strict mode not to disable it. So setting it to false ["transform-strict-mode", {"strict": false}] will change nothing, in your case better remove this plug-in then including it. But if somewhere else you are using a plugin or preset that includes the strict mode, try maybe to use es2015-loose :

    1. install

      npm install --save-dev babel-preset-es2015-loose babel-preset-es2015

    2. config

      {"presets": ["es2015-loose"]}

提交回复
热议问题