Skip to content

Commit abb8d9b

Browse files
committed
Pre-compile ES6 for people using npm
Fixes #863
1 parent a484780 commit abb8d9b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
examples/**/*-bundle.js
22
node_modules
3-
npm-debug.log
3+
npm
4+
npm-debug.log

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"scripts": {
1616
"build": "NODE_ENV=production webpack modules/index.js dist/react-router.js",
1717
"build-min": "NODE_ENV=production COMPRESS=1 webpack modules/index.js dist/react-router.min.js",
18+
"build-npm": "babel -d npm/lib ./modules && cp README.md npm && node -p \"p=require('./package');p.main='lib/index.js';p.scripts=undefined;JSON.stringify(p,null,2)\" > npm/package.json",
1819
"examples": "webpack-dev-server --config examples/webpack.config.js --no-info --content-base examples",
20+
"prepublish": "npm run build-npm",
1921
"test": "jsxhint . && karma start"
2022
},
2123
"authors": [
@@ -24,6 +26,7 @@
2426
],
2527
"license": "MIT",
2628
"devDependencies": {
29+
"babel": "^4.4.5",
2730
"bundle-loader": "^0.5.2",
2831
"events": "1.0.2",
2932
"expect": "^1.1.0",
@@ -61,4 +64,4 @@
6164
"routes",
6265
"router"
6366
]
64-
}
67+
}

0 commit comments

Comments
 (0)