Skip to content

Commit

Permalink
Add es2015 modules export from redux project (#501)
Browse files Browse the repository at this point in the history
* Remove Style section

Obviously that didn't happen...

* Add es2015 modules export from redux project
  • Loading branch information
btd authored and timdorr committed Sep 27, 2016
1 parent b6e29ea commit 746c450
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
11 changes: 10 additions & 1 deletion .babelrc
Expand Up @@ -18,14 +18,23 @@
"transform-es2015-parameters",
["transform-es2015-destructuring", { "loose": true }],
"transform-es2015-block-scoping",
["transform-es2015-modules-commonjs", { "loose": true }],
"transform-object-rest-spread",
"transform-react-jsx",
"syntax-jsx"
],
"env": {
"test": {
"plugins": ["istanbul"]
},
"commonjs": {
"plugins": [
["transform-es2015-modules-commonjs", { "loose": true }]
]
},
"es": {
"plugins": [
"./build/use-lodash-es"
]
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ dist
lib
.nyc_output
coverage
es
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -54,10 +54,6 @@ npm run lint

Please open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept.

###Style

[reactjs](https://github.com/reactjs) is trying to keep a standard style across its various projects, which can be found over in [eslint-config-reactjs](https://github.com/reactjs/eslint-config-reactjs). If you have a style change proposal, it should first be proposed there. If accepted, we will be happy to accept a PR to implement it here.

## Submitting Changes

* Open a new issue in the [Issue tracker](https://github.com/reactjs/react-redux/issues).
Expand Down
10 changes: 10 additions & 0 deletions build/use-lodash-es.js
@@ -0,0 +1,10 @@
module.exports = function () {
return {
visitor: {
ImportDeclaration(path) {
var source = path.node.source
source.value = source.value.replace(/^lodash($|\/)/, 'lodash-es$1')
}
}
}
}
19 changes: 12 additions & 7 deletions package.json
Expand Up @@ -3,15 +3,18 @@
"version": "4.4.5",
"description": "Official React bindings for Redux",
"main": "./lib/index.js",
"module": "es/index.js",
"jsnext:main": "es/index.js",
"scripts": {
"build:lib": "babel src --out-dir lib",
"build:umd": "cross-env NODE_ENV=development webpack src/index.js dist/react-redux.js",
"build:umd:min": "cross-env NODE_ENV=production webpack src/index.js dist/react-redux.min.js",
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min && node ./prepublish",
"clean": "rimraf lib dist coverage",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack src/index.js dist/redux.js",
"build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack src/index.js dist/redux.min.js",
"build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min",
"clean": "rimraf lib dist es coverage",
"lint": "eslint src test",
"prepublish": "npm run clean && npm run build",
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-register --recursive --require ./test/setup.js",
"test": "cross-env BABEL_ENV=commonjs NODE_ENV=test mocha --compilers js:babel-register --recursive --require ./test/setup.js",
"test:watch": "npm test -- --watch",
"test:cov": "cross-env NODE_ENV=test nyc npm test",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
Expand All @@ -23,7 +26,8 @@
"files": [
"dist",
"lib",
"src"
"src",
"es"
],
"keywords": [
"react",
Expand Down Expand Up @@ -95,6 +99,7 @@
"hoist-non-react-statics": "^1.0.3",
"invariant": "^2.0.0",
"lodash": "^4.2.0",
"lodash-es": "^4.2.0",
"loose-envify": "^1.1.0"
},
"peerDependencies": {
Expand Down

0 comments on commit 746c450

Please sign in to comment.