Skip to content

Commit

Permalink
Added es build, which will get beneficial for es2015 modules aware bu…
Browse files Browse the repository at this point in the history
…ndlers like webpack 2+ and rollup
  • Loading branch information
Andarist committed Jun 20, 2017
1 parent 129f4e4 commit 462af90
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 23 deletions.
14 changes: 2 additions & 12 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"presets": [
["latest", {
"es2015": { "loose": true }
}],
"stage-2",
"react"
],
"plugins": [
"dev-expression",
"add-module-exports",
"transform-object-assign",
["transform-react-remove-prop-types", { mode: "wrap" }]
],
"./.babelrc.js"
]
}
18 changes: 18 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const modules = process.env.BABEL_ENV === 'es' ? false : 'commonjs'

const presets = [
['latest', {
es2015: { loose: true, modules }
}],
'stage-2',
'react'
]

const plugins = [
'dev-expression',
'add-module-exports',
'transform-object-assign',
['transform-react-remove-prop-types', { mode: 'wrap' }]
]

module.exports = { plugins, presets }
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/es
/lib

# Logs
Expand Down
7 changes: 7 additions & 0 deletions CSSTransition/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "react-transition-group/CSSTransition",
"private": true,
"main": "../lib/CSSTransition.js",
"module": "../es/CSSTransition.js",
"jsnext:main": "../es/CSSTransition.js"
}
7 changes: 7 additions & 0 deletions Transition/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "react-transition-group/Transition",
"private": true,
"main": "../lib/Transition.js",
"module": "../es/Transition.js",
"jsnext:main": "../es/Transition.js"
}
7 changes: 7 additions & 0 deletions TransitionGroup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "react-transition-group/TransitionGroup",
"private": true,
"main": "../lib/TransitionGroup.js",
"module": "../es/TransitionGroup.js",
"jsnext:main": "../es/TransitionGroup.js"
}
17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
"version": "2.0.0-beta.0",
"description": "A react component toolset for managing animations",
"main": "lib/index.js",
"module": "es/index.js",
"jsnext:main": "es/index.js",
"files": [
"es",
"lib",
"CSSTransition",
"Transition",
"TransitionGroup"
],
"scripts": {
"test": "jest --runInBand --verbose",
"tdd": "jest --watch",
"build": "rimraf lib && babel src --out-dir lib && npm run build:dist",
"build": "rimraf es lib && npm run build:es && npm run build:cjs && npm run build:dist",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir lib",
"build:dist": "rimraf lib/dist && webpack && NODE_ENV=production webpack -p",
"lint": "eslint src test",
"release": "release",
Expand Down Expand Up @@ -65,6 +76,7 @@
"babel-preset-latest": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.18.0",
"cross-env": "^5.0.1",
"css-literal-loader": "^0.2.0",
"css-loader": "^0.28.0",
"eslint": "^3.17.1",
Expand All @@ -82,9 +94,6 @@
"teaspoon": "^6.4.3",
"webpack": "^2.2.1"
},
"release-script": {
"altPkgRootFolder": "lib"
},
"browserify": {
"transform": [
"loose-envify"
Expand Down
7 changes: 1 addition & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ import CSSTransition from './CSSTransition';
import TransitionGroup from './TransitionGroup';
import Transition from './Transition';


module.exports = {
Transition,
TransitionGroup,
CSSTransition,
};
export { Transition, TransitionGroup, CSSTransition }
46 changes: 45 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,21 @@ create-react-class@^15.5.2:
fbjs "^0.8.9"
object-assign "^4.1.1"

cross-env@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.0.1.tgz#ff4e72ea43b47da2486b43a7f2043b2609e44913"
dependencies:
cross-spawn "^5.1.0"
is-windows "^1.0.0"

cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
dependencies:
lru-cache "^4.0.1"
shebang-command "^1.2.0"
which "^1.2.9"

cryptiles@2.x.x:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
Expand Down Expand Up @@ -3170,6 +3185,10 @@ is-utf8@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"

is-windows@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9"

isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
Expand Down Expand Up @@ -3724,6 +3743,13 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
dependencies:
js-tokens "^3.0.0"

lru-cache@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
dependencies:
pseudomap "^1.0.2"
yallist "^2.1.2"

macaddress@^0.2.8:
version "0.2.8"
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
Expand Down Expand Up @@ -4628,6 +4654,10 @@ prr@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

public-encrypt@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
Expand Down Expand Up @@ -5145,6 +5175,16 @@ shallowequal@0.2.x, shallowequal@^0.2.2:
dependencies:
lodash.keys "^3.1.2"

shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
dependencies:
shebang-regex "^1.0.0"

shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"

shelljs@^0.5.1:
version "0.5.3"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113"
Expand Down Expand Up @@ -5828,7 +5868,7 @@ which-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"

which@^1.2.12:
which@^1.2.12, which@^1.2.9:
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
Expand Down Expand Up @@ -5906,6 +5946,10 @@ y18n@^3.2.0, y18n@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"

yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

yargs-parser@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c"
Expand Down

0 comments on commit 462af90

Please sign in to comment.