Skip to content

Commit

Permalink
Merge pull request #26 from andnp/Rollup
Browse files Browse the repository at this point in the history
perf: use rollup.js to bundle lib
  • Loading branch information
andnp committed Jul 9, 2018
2 parents 5b3b52f + 491ed67 commit e5f5163
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules/
.vscode/
dist/
coverage/

.rpt2_cache
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"name": "maybetyped",
"version": "0.0.0",
"description": "Well-typed functional Maybe monad",
"main": "dist/src/index",
"types": "dist/src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.mjs",
"scripts": {
"commitmsg": "commitlint -e $GIT_PARAMS",
"lint": "tslint --config tslint.json --project . --format stylish",
"test": "jest",
"rollup/cjs": "rollup --format cjs --config rollup.config.js --file dist/index.js",
"rollup/esm": "rollup --format esm --config rollup.config.js --file dist/index.mjs",
"tsc": "tsc",
"prepush": "npm run -s lint && npm test",
"release": "rm -rf dist && npm run tsc && npx semantic-release"
"prepush": "run-s lint test",
"release": "rm -rf dist && run-s rollup/cjs rollup/esm && npx semantic-release"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,6 +59,9 @@
"commitlint": "^7.0.0",
"husky": "^0.14.3",
"jest": "^22.4.3",
"npm-run-all": "^4.1.3",
"rollup": "^0.62.0",
"rollup-plugin-typescript2": "^0.15.1",
"ts-jest": "^23.0.0",
"ts-node": "^7.0.0",
"tslint": "^5.9.1",
Expand Down
11 changes: 11 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import typescript from 'rollup-plugin-typescript2';

export default {
input: './src/index.ts',

plugins: [
typescript({
tsconfig: "tsconfig.json"
})
]
}
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"strict": true,
"noUnusedLocals": true,
"moduleResolution": "node",
"module": "commonjs",
"module": "esnext",
"target": "es5",
"noImplicitAny": true,
"noImplicitThis": true,
Expand All @@ -19,8 +19,7 @@
],
},
"include": [
"src/",
"tests"
"src/"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit e5f5163

Please sign in to comment.