From d08b96e6e097fa95b5c6484dbd0d63f02fc74fcf Mon Sep 17 00:00:00 2001 From: Andrew Fuller Date: Fri, 16 Jun 2017 00:10:03 -0500 Subject: [PATCH] Create es and commonjs separate build steps --- .gitignore | 4 ++++ package.json | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 415ff5c4..87f27558 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ _book *.diff examples/__build__ coverage + +## Built folders +es +lib diff --git a/package.json b/package.json index 1d161291..326b2a8f 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "version": "2.0.0", "description": "Accessible modal dialog component for React.JS", "main": "./lib/index.js", + "module": "./es/index.js", + "jsnext:main": "./es/index.js", "repository": { "type": "git", "url": "https://github.com/reactjs/react-modal.git" @@ -15,19 +17,25 @@ "scripts": { "start": "./node_modules/.bin/webpack-dev-server --inline --host 127.0.0.1 --content-base examples/", "test": "cross-env NODE_ENV=test karma start", - "lint": "eslint lib/" + "lint": "eslint lib/", + "clean": "rimraf lib es", + "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": "npm run clean && npm run build:commonjs && npm run build:es" }, "authors": [ "Ryan Florence" ], "license": "MIT", "devDependencies": { - "babel-core": "^6.7.4", + "babel-cli": "^6.24.1", + "babel-core": "^6.25.0", "babel-eslint": "^7.1.1", "babel-loader": "^6.2.4", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", - "babel-preset-stage-2": "^6.24.1", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.23.0", + "babel-preset-env": "^1.5.2", + "babel-preset-react": "^6.24.1", "codeclimate-test-reporter": "^0.4.0", "coveralls": "^2.13.1", "cross-env": "^5.0.1", @@ -55,7 +63,7 @@ "react-addons-test-utils": "^15.0.0", "react-dom": "^15.0.0", "rf-release": "0.4.0", - "rimraf": "^2.5.4", + "rimraf": "^2.6.1", "sinon": "next", "uglify-js": "2.4.24", "webpack": "^1.12.14",