Enable strict mode for transform-es2015-modules-commonjs
Summary:Since #5422 react-native works with strict mode modules but the transform was not updated since Facebook has some non strict mode compatible internal modules. Now that #5214 has landed and it is easy to change the babel config I think we should enable it by default to make es2015 modules spec compliant. Someone at Facebook will have to make the internal changes necessary to disable strict mode modules for their projects that use non strict mode compatible modules by including a .babelrc file with ``` json { "presets": [ "react-native" ], "plugins": [ ["transform-es2015-modules-commonjs", { "strict": false, "allowTopLevelThis": true }] ] } ``` before merging this. We might also want to mention this in the breaking change section for the next release. Closes https://github.com/facebook/react-native/pull/5796 Differential Revision: D3075802 fb-gh-sync-id: e807b67401107e1e944db38453e254025ce0a6c7 shipit-source-id: e807b67401107e1e944db38453e254025ce0a6c7
This commit is contained in:
parent
d033c45f93
commit
36893ecfa0
|
@ -24,7 +24,7 @@ module.exports = {
|
|||
'transform-es2015-computed-properties',
|
||||
'transform-es2015-constants',
|
||||
'transform-es2015-destructuring',
|
||||
['transform-es2015-modules-commonjs', { strict: false, allowTopLevelThis: true }],
|
||||
['transform-es2015-modules-commonjs', { allowTopLevelThis: true }],
|
||||
'transform-es2015-parameters',
|
||||
'transform-es2015-shorthand-properties',
|
||||
'transform-es2015-spread',
|
||||
|
|
Loading…
Reference in New Issue