Skip to content

Commit 3cd945f

Browse files
committed
Updated prepublishing script
1 parent 070b48d commit 3cd945f

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"presets": ["es2015", "react", "stage-2"],
2+
"presets": ["es2015", "react", "stage-0"],
33
"env": {
44
"development": {
55
"presets": ["react-hmre"]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ npm-debug.log
88
node_modules
99
.env
1010
public/
11-
dist
11+
dist/

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
.eslintrc
99
npm-debug.log
1010
lib
11+
src/
12+
examples/
13+
public/
14+
scripts/

examples/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {Router, hashHistory, Redirect, Route, IndexRoute, Link} from 'react-rout
44

55
import styles from './global.styles.css';
66

7-
console.log(styles);
8-
97
import Container from './Container'
108

119
const routeMap = {
@@ -55,7 +53,6 @@ const routes = (
5553
)
5654

5755
const mountNode = document.querySelector('#root')
58-
console.log(mountNode);
5956
if (mountNode) {
6057
ReactDOM.render(routes, mountNode);
6158
} else {

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"main": "dist/index.js",
1515
"scripts": {
16-
"prepublish": "babel --plugins 'transform-es2015-modules-umd' src --ignore __tests__ --out-dir ./dist",
16+
"prepublish": ". ./scripts/prepublish.sh",
1717
"dev": "NODE_ENV=development ./node_modules/hjs-webpack/bin/hjs-dev-server.js",
1818
"build": "NODE_ENV=production webpack",
1919
"publish_pages": "gh-pages -d public/",
@@ -25,7 +25,7 @@
2525
},
2626
"devDependencies": {
2727
"autoprefixer": "^6.3.6",
28-
"babel-cli": "^6.6.4",
28+
"babel-cli": "^6.7.7",
2929
"babel-core": "^6.7.4",
3030
"babel-eslint": "^6.0.2",
3131
"babel-loader": "^6.2.4",
@@ -34,7 +34,9 @@
3434
"babel-preset-es2015": "^6.6.0",
3535
"babel-preset-react": "^6.5.0",
3636
"babel-preset-react-hmre": "^1.1.1",
37+
"babel-preset-stage-0": "^6.5.0",
3738
"babel-preset-stage-2": "^6.5.0",
39+
"babel-runtime": "^6.6.1",
3840
"chai": "^3.5.0",
3941
"chai-spies": "^0.7.1",
4042
"css-loader": "^0.23.1",
@@ -45,6 +47,7 @@
4547
"eslint-plugin-babel": "^3.1.0",
4648
"eslint-plugin-react": "^4.2.3",
4749
"file-loader": "^0.8.5",
50+
"highlight.js": "^9.3.0",
4851
"hjs-webpack": "^8.1.0",
4952
"invariant": "^2.2.1",
5053
"jsdom": "^8.1.0",
@@ -57,6 +60,7 @@
5760
"react": "^15.0.0",
5861
"react-addons-test-utils": "^15.0.0",
5962
"react-dom": "^15.0.0",
63+
"react-router": "^2.4.0",
6064
"sinon": "^1.17.3",
6165
"style-loader": "^0.13.1",
6266
"url-loader": "^0.5.7",
@@ -66,9 +70,5 @@
6670
"react": "~0.14.8 || ^15.0.0",
6771
"react-dom": "~0.14.8 || ^15.0.0"
6872
},
69-
"dependencies": {
70-
"babel-runtime": "^6.6.1",
71-
"highlight.js": "^9.3.0",
72-
"react-router": "^2.4.0"
73-
}
73+
"dependencies": {}
7474
}

scripts/prepublish.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
echo "=> Transpiling..."
4+
echo ""
5+
export NODE_ENV=production
6+
rm -rf ./dist
7+
./node_modules/.bin/babel \
8+
--plugins 'transform-es2015-modules-umd' \
9+
--presets 'stage-0,react' \
10+
--ignore __tests__ \
11+
--out-dir ./dist \
12+
src
13+
echo ""
14+
echo "=> Complete"

0 commit comments

Comments
 (0)