Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
Enable strict mode for transform-es2015-modules-commonjs
Browse files Browse the repository at this point in the history
Summary:Since facebook#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 facebook#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 facebook#5796

Differential Revision: D3075802

fb-gh-sync-id: e807b67401107e1e944db38453e254025ce0a6c7
shipit-source-id: e807b67401107e1e944db38453e254025ce0a6c7
  • Loading branch information
janicduplessis authored and Facebook Github Bot 9 committed Mar 21, 2016
1 parent d033c45 commit 36893ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion babel-preset/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 36893ec

Please sign in to comment.