Skip to content

Commit d08b96e

Browse files
Andrew Fullerdiasbruno
Andrew Fuller
authored andcommitted
Create es and commonjs separate build steps
1 parent d024d3a commit d08b96e

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ _book
88
*.diff
99
examples/__build__
1010
coverage
11+
12+
## Built folders
13+
es
14+
lib

package.json

+14-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "2.0.0",
44
"description": "Accessible modal dialog component for React.JS",
55
"main": "./lib/index.js",
6+
"module": "./es/index.js",
7+
"jsnext:main": "./es/index.js",
68
"repository": {
79
"type": "git",
810
"url": "https://github.com/reactjs/react-modal.git"
@@ -15,19 +17,25 @@
1517
"scripts": {
1618
"start": "./node_modules/.bin/webpack-dev-server --inline --host 127.0.0.1 --content-base examples/",
1719
"test": "cross-env NODE_ENV=test karma start",
18-
"lint": "eslint lib/"
20+
"lint": "eslint lib/",
21+
"clean": "rimraf lib es",
22+
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
23+
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
24+
"build": "npm run clean && npm run build:commonjs && npm run build:es"
1925
},
2026
"authors": [
2127
"Ryan Florence"
2228
],
2329
"license": "MIT",
2430
"devDependencies": {
25-
"babel-core": "^6.7.4",
31+
"babel-cli": "^6.24.1",
32+
"babel-core": "^6.25.0",
2633
"babel-eslint": "^7.1.1",
2734
"babel-loader": "^6.2.4",
28-
"babel-preset-es2015": "^6.6.0",
29-
"babel-preset-react": "^6.5.0",
30-
"babel-preset-stage-2": "^6.24.1",
35+
"babel-plugin-transform-class-properties": "^6.24.1",
36+
"babel-plugin-transform-object-rest-spread": "^6.23.0",
37+
"babel-preset-env": "^1.5.2",
38+
"babel-preset-react": "^6.24.1",
3139
"codeclimate-test-reporter": "^0.4.0",
3240
"coveralls": "^2.13.1",
3341
"cross-env": "^5.0.1",
@@ -55,7 +63,7 @@
5563
"react-addons-test-utils": "^15.0.0",
5664
"react-dom": "^15.0.0",
5765
"rf-release": "0.4.0",
58-
"rimraf": "^2.5.4",
66+
"rimraf": "^2.6.1",
5967
"sinon": "next",
6068
"uglify-js": "2.4.24",
6169
"webpack": "^1.12.14",

0 commit comments

Comments
 (0)