Skip to content

Commit

Permalink
Chore(Webpack):Bundle with webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
codenaz committed Mar 13, 2019
1 parent cf10255 commit 74aa09c
Show file tree
Hide file tree
Showing 8 changed files with 5,418 additions and 1,456 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/env", "@babel/preset-react"]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# React Paginator
# React Hooks Paginator

![demo](./animate.gif)
A library for adding simple paginator functionality to your react app.
Expand All @@ -8,7 +8,7 @@ Requires react >= 16.8.\*
## Installation

Run the following command:
`npm install react-paginator`
`npm install react-hooks-paginator`

## Usage

Expand Down
12 changes: 12 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

6,772 changes: 5,324 additions & 1,448 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 35 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
{
"name": "react-paginator",
"name": "react-hooks-paginator",
"description": "A package for adding paginator functionality to react apps",
"version": "0.1.0",
"main": "dist/index.js",
"module": "dist/index.js",
"files": [
"dist",
"animate.gif",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/emekadev/react-paginator"
},
"keywords": [
"react",
"paginate",
"page",
"pagination",
"paginator"
],
"author": {
"name": "Nwakwoke Patrick",
"email": "[email protected]"
},
"license": "MIT",
"dependencies": {
"bootstrap": "^4.3.1",
"reactstrap": "^7.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
"build": "webpack",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"prepublish": "npm run build"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -30,12 +45,28 @@
"not ie <= 11",
"not op_mini all"
],
"peerDependencies": {
"react": ">=16.8.*",
"react-dom": ">=16.8.*"
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-cli": "^6.26.0",
"babel-loader": "^8.0.5",
"babel-preset-react": "^6.24.1",
"css-loader": "^2.1.1",
"node-sass": "^4.11.0",
"prettier": "^1.16.4",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8"
"react-scripts": "2.1.8",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.28.3",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.1.14"
}
}
4 changes: 2 additions & 2 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Pagination from './pagination';
import Pagination from './paginator';

export default Pagination;
export default Pagination;
File renamed without changes.
40 changes: 40 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const path = require('path');
const webpack = require('webpack');

module.exports = {
entry: './src/lib/index.js',
mode: 'production',
output: {
path: path.join(__dirname, './dist'),
publicPath: '/dist/',
filename: 'index.js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
options: { presets: ['@babel/env'] }
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
}
]
},
resolve: {
alias: {
'react-hooks-paginator': path.resolve(__dirname, './src/lib')
},
extensions: ['*', '.js', '.jsx']
},
externals: {
react: 'commonjs react'
}
};

0 comments on commit 74aa09c

Please sign in to comment.