Skip to content

Commit

Permalink
Merge pull request #2530 from taion/es6-build
Browse files Browse the repository at this point in the history
Add ES6 module build
  • Loading branch information
taion committed Nov 20, 2015
2 parents 783782d + 3280c5e commit 6884ff1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
es6
lib
umd
examples/**/*-bundle.js
Expand Down
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [HEAD]

- Add ES2015 module build ([#2530])

[#2530]: https://github.com/rackt/react-router/pull/2530

## [v1.0.0]

Expand Down Expand Up @@ -355,5 +357,3 @@ To cancel a "transition from", please refer to the

There's a lot of the old API we've missed, please give the [new
docs](/docs) a read and help us fill this guide in. Thanks!


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Using [npm](https://www.npmjs.com/):

Note that you need to also install the [history](https://www.npmjs.com/package/history) package since it is a peer dependency of React Router and won't automatically be installed for you in npm 3+.

Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
Then with a module bundler like [webpack](https://webpack.github.io/) that supports either CommonJS or ES2015 modules, use as you would anything else:

```js
// using an ES6 transpiler, like babel
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
"files": [
"*.md",
"docs",
"es6",
"lib",
"npm-scripts",
"umd"
],
"main": "lib/index",
"jsnext:main": "es6/index",
"repository": {
"type": "git",
"url": "https://github.com/rackt/react-router.git"
},
"homepage": "https://rackt.github.io/react-router/",
"bugs": "https://github.com/rackt/react-router/issues",
"scripts": {
"build": "rimraf lib && babel ./modules -d lib --ignore '__tests__'",
"build": "npm run build-cjs && npm run build-es6",
"build-cjs": "rimraf lib && babel ./modules -d lib --ignore '__tests__'",
"build-es6": "rimraf es6 && babel ./modules -d es6 --blacklist=es6.modules --ignore '__tests__'",
"build-umd": "NODE_ENV=production webpack modules/index.js umd/ReactRouter.js",
"build-min": "NODE_ENV=production webpack -p modules/index.js umd/ReactRouter.min.js",
"lint": "eslint modules examples",
Expand Down

0 comments on commit 6884ff1

Please sign in to comment.