Skip to content

Commit

Permalink
chore(package): commonjs bundled package
Browse files Browse the repository at this point in the history
  • Loading branch information
dispix committed Oct 28, 2018
1 parent 8352738 commit 8278a2f
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Build
build/

# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
Expand Down Expand Up @@ -40,6 +39,4 @@ node_modules/
.yarn-integrity

# dotenv environment variables file
.env

# End of https://www.gitignore.io/api/node
.env
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Sets of useful hooks for react 16.7 and above",
"main": "./src/index.js",
"scripts": {
"test": "test"
"test": "test",
"prepublish": "rollup -c"
},
"repository": {
"type": "git",
Expand All @@ -20,7 +21,17 @@
"url": "https://github.com/dispix/react-pirate/issues"
},
"homepage": "https://github.com/dispix/react-pirate#readme",
"files": [
"build",
"package.json",
"README.md"
],
"peerDependencies": {
"react": ">=16.7.0-alpha.0"
},
"devDependencies": {
"rollup": "^0.66.6",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^3.4.0"
}
}
}
12 changes: 12 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'

export default {
input: 'src/index.js',
output: {
file: 'build/index.cjs.js',
format: 'cjs',
},
plugins: [resolve(), commonjs()],
external: ['react'],
}
Loading

0 comments on commit 8278a2f

Please sign in to comment.