Skip to content

Commit 48c1655

Browse files
committed
update build:cjs-legacy
1 parent de51d37 commit 48c1655

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

.babelrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,14 @@
1414
"lodash",
1515
"add-module-exports",
1616
"transform-remove-strict-mode"
17-
]
17+
],
18+
"env": {
19+
"legacy": {
20+
"plugins": [
21+
["import-rename", {
22+
"^react-dom/lib/(.*)$": "react/lib/$1"
23+
}]
24+
]
25+
}
26+
}
1827
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ logs
1111
node_modules
1212
dist
1313
lib
14+
legacy

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"start": "npm run karma -- start",
77
"test": "npm run karma -- start --single-run",
88
"karma": "cross-env ANIMATED_TEST=true babel-node -- ./node_modules/.bin/karma",
9-
"prebuild": "rimraf ./dist ./lib && mkdirp ./dist ./lib",
10-
"build:cjs-legacy": "babel src -d lib/legacy",
9+
"prebuild": "rimraf ./dist ./lib ./legacy && mkdirp ./dist ./lib ./legacy",
10+
"build:cjs-legacy": "cross-env BABEL_ENV=legacy babel src -d legacy",
1111
"build:cjs": "babel src -d lib",
1212
"build:umd": "webpack src dist/react-web-animated.js",
1313
"build:min": "webpack -p src dist/react-web-animated.min.js",
@@ -18,6 +18,7 @@
1818
"files": [
1919
"dist",
2020
"lib",
21+
"legacy",
2122
"README.md"
2223
],
2324
"author": "cap32",
@@ -27,6 +28,7 @@
2728
"babel-core": "^6.17.0",
2829
"babel-loader": "^6.2.5",
2930
"babel-plugin-add-module-exports": "^0.2.1",
31+
"babel-plugin-import-rename": "^1.0.1",
3032
"babel-plugin-lodash": "^3.2.9",
3133
"babel-plugin-module-resolver": "^2.2.0",
3234
"babel-plugin-system-import-transformer": "^2.4.0",

src/AnimatedImplementation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ var SpringConfig = require('SpringConfig');
2121
var ViewStylePropTypes = require('ViewStylePropTypes');
2222
var NativeAnimatedHelper = require('NativeAnimatedHelper');
2323

24-
var findNodeHandle = require('react-dom/lib/findDOMNode');
25-
// var findNodeHandle = require('react/lib/findNodeHandle');
24+
var findNodeHandle = require('react-dom').findDOMNode;
2625

2726
var flattenStyle = require('flattenStyle');
2827
var invariant = require('fbjs/lib/invariant');

yarn.lock

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ babel-plugin-check-es2015-constants@^6.3.13:
377377
dependencies:
378378
babel-runtime "^6.0.0"
379379

380+
babel-plugin-import-rename@^1.0.1:
381+
version "1.0.1"
382+
resolved "http://registry.npm.taobao.org/babel-plugin-import-rename/download/babel-plugin-import-rename-1.0.1.tgz#bd60618aa90a36dd944b186552da1dc389a449cf"
383+
380384
babel-plugin-lodash@^3.2.9:
381385
version "3.2.9"
382386
resolved "http://registry.npm.taobao.org/babel-plugin-lodash/download/babel-plugin-lodash-3.2.9.tgz#062f85aa7810fbb4374a1a7372ecc44b09168760"
@@ -2796,14 +2800,6 @@ react-dom@^15.4.2:
27962800
loose-envify "^1.1.0"
27972801
object-assign "^4.1.0"
27982802

2799-
react@15.3@15.3.2:
2800-
version "15.3.2"
2801-
resolved "http://registry.npm.taobao.org/react/download/react-15.3.2.tgz#a7bccd2fee8af126b0317e222c28d1d54528d09e"
2802-
dependencies:
2803-
fbjs "^0.8.4"
2804-
loose-envify "^1.1.0"
2805-
object-assign "^4.1.0"
2806-
28072803
react@15.4.2:
28082804
version "15.4.2"
28092805
resolved "http://registry.npm.taobao.org/react/download/react-15.4.2.tgz#41f7991b26185392ba9bae96c8889e7e018397ef"

0 commit comments

Comments
 (0)