Skip to content

Commit cd98944

Browse files
wbazantpodefr
authored andcommitted
Use babel to prepare the lib directory as an alternative to webpack's umd mode
1 parent 0dbb6f5 commit cd98944

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "A React higher order component that will debounce the rendering of your React components",
66
"main": "lib/index.js",
77
"scripts": {
8-
"prepublish": "webpack",
8+
"prepublishOnly": "rm -rf lib && babel src -d lib --copy-files",
99
"test": "cd e2e; CI=true npm test; cd .."
1010
},
1111
"keywords": [
@@ -17,15 +17,17 @@
1717
],
1818
"author": "Olivier Scherrer <[email protected]>",
1919
"license": "MIT",
20-
"dependencies": {},
20+
"dependencies": {
21+
"lodash": "^4.17.4",
22+
"react": "^15.6.1"
23+
},
2124
"devDependencies": {
25+
"babel-cli": "^6.24.1",
2226
"babel-core": "^6.25.0",
2327
"babel-loader": "^7.0.0",
2428
"babel-preset-es2015": "^6.24.1",
2529
"babel-preset-react": "^6.24.1",
26-
"babel-preset-stage-0": "^6.24.1",
27-
"lodash.debounce": "^4.0.8",
28-
"webpack": "^2.6.1"
30+
"babel-preset-stage-0": "^6.24.1"
2931
},
3032
"repository": {
3133
"type": "git",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import debounce from 'lodash.debounce';
2+
import {debounce} from 'lodash';
33

44
module.exports = function debounceRender(ComponentToDebounce, ...debounceArgs) {
55
return class DebouncedContainer extends Component {
@@ -28,4 +28,4 @@ module.exports = function debounceRender(ComponentToDebounce, ...debounceArgs) {
2828
return <ComponentToDebounce { ...this.state } />;
2929
}
3030
}
31-
};
31+
};

webpack.config.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)