Skip to content

Commit

Permalink
fix: target ES5 for production code
Browse files Browse the repository at this point in the history
Fix #758
  • Loading branch information
gregberge committed Jan 1, 2018
1 parent df48a40 commit b1d6d05
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"husky": "^0.14.3",
"jest": "^22.0.4",
"lerna": "^2.4.0",
"lerna-tools": "^0.0.3",
"lerna-tools": "^1.0.0",
"lint-staged": "^6.0.0",
"mocha": "^4.0.1",
"prettier": "^1.9.2",
Expand Down
10 changes: 3 additions & 7 deletions packages/react-hot-loader/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-disable global-require, import/no-mutable-exports */

let exportedModule
/* eslint-disable global-require, import/no-mutable-exports, no-var */

if (!module.hot || process.env.NODE_ENV === 'production') {
exportedModule = require('./index.prod')
module.exports = require('./prod/index.prod')
} else {
exportedModule = require('./index.dev')
module.exports = require('./index.dev')
}

module.exports = exportedModule
8 changes: 2 additions & 6 deletions packages/react-hot-loader/src/patch.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-disable global-require, import/no-mutable-exports */

let exportedModule

if (!module.hot || process.env.NODE_ENV === 'production') {
exportedModule = require('./patch.prod').default
module.exports = require('./prod/patch.prod')
} else {
exportedModule = require('./patch.dev').default
module.exports = require('./patch.dev')
}

export default exportedModule
1 change: 0 additions & 1 deletion packages/react-hot-loader/src/patch.prod.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/react-hot-loader/src/prod/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"babelrc": false,
"presets": [["env", { "loose": true }], "react"]
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/react-hot-loader/src/prod/patch.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
File renamed without changes.
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3656,9 +3656,9 @@ left-pad@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"

lerna-tools@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/lerna-tools/-/lerna-tools-0.0.3.tgz#8c012d9345a7885ae253bce74ebb0cd72f266782"
lerna-tools@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lerna-tools/-/lerna-tools-1.0.0.tgz#137bf98cd34e51289e779dcca61bc77162400fcf"
dependencies:
chalk "^2.1.0"
glob "^7.1.2"
Expand Down

0 comments on commit b1d6d05

Please sign in to comment.