Skip to content

Commit 271364c

Browse files
committed
Revert "feat: support ESM (tree-shaking) (#455)"
This reverts commit ef3e357. Fixes #475
1 parent 6775233 commit 271364c

File tree

5 files changed

+20
-41
lines changed

5 files changed

+20
-41
lines changed

package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
"name": "react-transition-group",
33
"version": "2.7.0",
44
"description": "A react component toolset for managing animations",
5-
"main": "lib/cjs/index.js",
6-
"module": "lib/esm/index.js",
5+
"main": "lib/index.js",
76
"scripts": {
87
"test": "npm run lint && npm run testonly",
98
"testonly": "jest --verbose",
109
"tdd": "jest --watch",
11-
"build": "rimraf lib && yarn build:cjs && yarn build:esm && yarn build:pick && yarn build:dist && cp README.md LICENSE ./lib",
10+
"build": "babel src --out-dir lib --delete-dir-on-start && npm run build:dist && cp README.md LICENSE ./lib",
1211
"build:docs": "npm -C www run build",
13-
"build:cjs": "babel src --out-dir lib/cjs",
14-
"build:esm": "cross-env BABEL_ENV=esm babel src --out-dir lib/esm",
15-
"build:pick": "cherry-pick --name=react-transition-group --cwd=lib --input-dir=../src --cjs-dir=cjs --esm-dir=esm",
16-
"build:dist": "cross-env BABEL_ENV=esm rollup -c",
12+
"build:dist": "cross-env BABEL_ENV=esm yarn rollup -c",
1713
"bootstrap": "yarn && yarn --cwd www",
1814
"lint": "eslint src test",
1915
"release": "release",
@@ -78,7 +74,6 @@
7874
"babel-loader": "^8.0.2",
7975
"babel-plugin-transform-react-remove-prop-types": "^0.4.18",
8076
"babel-preset-jason": "^6.0.1",
81-
"cherry-pick": "^0.3.0",
8277
"cross-env": "^5.2.0",
8378
"enzyme": "^3.6.0",
8479
"enzyme-adapter-react-16": "^1.5.0",

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import replace from 'rollup-plugin-replace';
55
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
66
import { terser } from 'rollup-plugin-terser';
77

8-
const input = './src/index.js';
8+
const input = './src/umd.js';
99
const name = 'ReactTransitionGroup';
1010
const globals = {
1111
react: 'React',

src/index.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
export { default as CSSTransition } from './CSSTransition';
2-
export { default as ReplaceTransition } from './ReplaceTransition';
3-
export { default as TransitionGroup } from './TransitionGroup';
4-
export { default as Transition } from './Transition';
1+
import CSSTransition from './CSSTransition';
2+
import ReplaceTransition from './ReplaceTransition';
3+
import TransitionGroup from './TransitionGroup';
4+
import Transition from './Transition';
5+
6+
7+
module.exports = {
8+
Transition,
9+
TransitionGroup,
10+
ReplaceTransition,
11+
CSSTransition,
12+
};

src/umd.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { default as CSSTransition } from './CSSTransition';
2+
export { default as ReplaceTransition } from './ReplaceTransition';
3+
export { default as TransitionGroup } from './TransitionGroup';
4+
export { default as Transition } from './Transition';

yarn.lock

-28
Original file line numberDiff line numberDiff line change
@@ -3419,16 +3419,6 @@ cheerio@^1.0.0-rc.2:
34193419
lodash "^4.15.0"
34203420
parse5 "^3.0.1"
34213421

3422-
cherry-pick@^0.3.0:
3423-
version "0.3.0"
3424-
resolved "https://registry.yarnpkg.com/cherry-pick/-/cherry-pick-0.3.0.tgz#b52626016c41197e6bffa0fc27074ae07988804a"
3425-
integrity sha512-N/+3l1f9yvD6Qpsj3jkBvSt5skLudVXGoSSQUy+yWoM13RjfVCvOiYLFr/JczOhTMwBPBuzE4WKCSxmYE1FFBg==
3426-
dependencies:
3427-
chalk "^2.4.1"
3428-
rimraf "^2.6.2"
3429-
tiny-glob "^0.2.0"
3430-
yargs "^11.0.0"
3431-
34323422
child-process-promise@^2.2.1:
34333423
version "2.2.1"
34343424
resolved "http://storage.mds.yandex.net/get-npm/38095/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074"
@@ -5644,11 +5634,6 @@ globals@^9.18.0:
56445634
version "9.18.0"
56455635
resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
56465636

5647-
globalyzer@^0.1.0:
5648-
version "0.1.0"
5649-
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465"
5650-
integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==
5651-
56525637
globby@8.0.1, globby@^8.0.0, globby@^8.0.1:
56535638
version "8.0.1"
56545639
resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50"
@@ -5672,11 +5657,6 @@ globby@^5.0.0:
56725657
pify "^2.0.0"
56735658
pinkie-promise "^2.0.0"
56745659

5675-
globrex@^0.1.1:
5676-
version "0.1.2"
5677-
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
5678-
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
5679-
56805660
got@^6.7.1:
56815661
version "6.7.1"
56825662
resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0"
@@ -11121,14 +11101,6 @@ timers-browserify@^2.0.4:
1112111101
dependencies:
1112211102
setimmediate "^1.0.4"
1112311103

11124-
tiny-glob@^0.2.0:
11125-
version "0.2.6"
11126-
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.6.tgz#9e056e169d9788fe8a734dfa1ff02e9b92ed7eda"
11127-
integrity sha512-A7ewMqPu1B5PWwC3m7KVgAu96Ch5LA0w4SnEN/LbDREj/gAD0nPWboRbn8YoP9ISZXqeNAlMvKSKoEuhcfK3Pw==
11128-
dependencies:
11129-
globalyzer "^0.1.0"
11130-
globrex "^0.1.1"
11131-
1113211104
tiny-relative-date@^1.3.0:
1113311105
version "1.3.0"
1113411106
resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07"

0 commit comments

Comments
 (0)