diff --git a/.npmignore b/.npmignore index e69de29..93f3929 100644 --- a/.npmignore +++ b/.npmignore @@ -0,0 +1,2 @@ +* +!lib/** diff --git a/package.json b/package.json index 93c9cc7..95e85ad 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "A React higher order component that will debounce the rendering of your React components", "main": "lib/index.js", "scripts": { - "prepublish": "webpack", + "prepublishOnly": "rm -rf lib && babel src -d lib --copy-files", "test": "cd e2e; CI=true npm test; cd .." }, "keywords": [ @@ -17,15 +17,17 @@ ], "author": "Olivier Scherrer ", "license": "MIT", - "dependencies": {}, + "dependencies": { + "lodash": "^4.17.4", + "react": "^15.6.1" + }, "devDependencies": { + "babel-cli": "^6.24.1", "babel-core": "^6.25.0", "babel-loader": "^7.0.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", - "babel-preset-stage-0": "^6.24.1", - "lodash.debounce": "^4.0.8", - "webpack": "^2.6.1" + "babel-preset-stage-0": "^6.24.1" }, "repository": { "type": "git", diff --git a/src/index.js b/src/index.js index d73466b..472e9f4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import debounce from 'lodash.debounce'; +import { debounce } from 'lodash'; module.exports = function debounceRender(ComponentToDebounce, ...debounceArgs) { return class DebouncedContainer extends Component { @@ -28,4 +28,4 @@ module.exports = function debounceRender(ComponentToDebounce, ...debounceArgs) { return ; } } -}; \ No newline at end of file +}; diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 4111f61..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,24 +0,0 @@ -var webpack = require('webpack'); -var path = require('path'); - -function getAbsolutePath(filename) { - return path.resolve(__dirname, filename); -} - -module.exports = { - entry: getAbsolutePath('src/index.js'), - output: { - path: getAbsolutePath('lib/'), - filename: 'index.js', - libraryTarget: 'umd' - }, - externals: { - "react": "react" - }, - module: { - loaders: [{ - test: /\.js/, - loader: 'babel-loader' - }], - } -}; \ No newline at end of file