Skip to content

Commit

Permalink
!refactor: build & export
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Apr 29, 2020
1 parent 987a02c commit 62a1027
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 134 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ setTimeout(() => {

## ESM & Typescript
```
import hrtime from 'browser-hrtime';
import * as hrtime from 'browser-hrtime';
// if typescripts "esModuleInterop": true => import hrtime from 'browser-hrtime';
const NS_PER_SEC = 1e9;
const time = hrtime();
Expand Down
33 changes: 0 additions & 33 deletions lib/cjs/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions lib/esm/index.d.ts

This file was deleted.

31 changes: 0 additions & 31 deletions lib/esm/index.js

This file was deleted.

1 change: 1 addition & 0 deletions lib/index.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions lib/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions lib/umd/index.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/umd/index.min.js

This file was deleted.

142 changes: 139 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
"name": "browser-hrtime",
"version": "1.0.4",
"description": "use process.hrtime() in the browser",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"main": "lib/index.js",
"module": "lib/index.es.js",
"browser": "lib/index.bundle.js",
"scripts": {
"test": "jest && nyc report --reporter=lcov",
"test": "jest && nyc report --reporter=lcov",
"build": "rollup -c && tsc",
"coverall": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"build": "npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min",
"build:esm": "tsc --module es2015 --target es5 --outDir lib/esm",
"build:cjs": "tsc --module commonjs --target es5 --outDir lib/cjs",
"build:umd": "rollup -c",
"build:umd:min": "cd lib/umd && terser --compress --mangle --comments -o index.min.js -- index.js",
"watch": "tsc --watch",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",
Expand Down Expand Up @@ -45,7 +42,9 @@
"puppeteer": "^3.0.1",
"puppeteer-to-istanbul": "^1.2.2",
"release-it": "^13.5.5",
"rollup": "^2.7.2",
"rollup": "^2.7.3",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.27.0",
"terser": "^4.6.12",
"ts-jest": "^25.4.0",
"tslint": "^6.1.1",
Expand Down
Loading

0 comments on commit 62a1027

Please sign in to comment.