Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit fbb9f3f

Browse files
committed
Create dual ES5 and ES2017 builds
1 parent b19afe7 commit fbb9f3f

6 files changed

+24
-13
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package-lock.json
22
node_modules
3-
dist/
3+
dist
4+
dist.browser
45
.nyc_output
56
coverage

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
.vscode
33
package.json
44
dist
5+
dist.browser
56
.nyc_output
67
*.json
78
docs

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"files": [
8-
"dist/**/*"
8+
"dist",
9+
"dist.browser"
910
],
11+
"browser": "dist.browser/index.js",
1012
"scripts": {
1113
"benchmarks": "npm run build && ts-node benchmarks/index.ts",
12-
"build": "ethereumjs-config-build",
14+
"build": "tsc -p tsconfig.json && tsc -p tsconfig.browser.json",
1315
"prepublishOnly": "npm run test && npm run build",
1416
"coverage": "nyc --reporter=lcov npm run test:node",
15-
"docs:build": "npx typedoc",
17+
"docs:build": "typedoc",
1618
"lint": "ethereumjs-config-lint",
1719
"lint:fix": "ethereumjs-config-lint-fix",
1820
"format": "ethereumjs-config-format",
@@ -21,7 +23,7 @@
2123
"tsc": "ethereumjs-config-tsc",
2224
"test": "npm run test:node && npm run test:browser",
2325
"test:browser": "npm run build && karma start karma.conf.js",
24-
"test:node": "npm run build && tape -r ts-node/register test/*.ts | tap-prettify -"
26+
"test:node": "npm run build && tape -r ts-node/register test/*.ts"
2527
},
2628
"husky": {
2729
"hooks": {
@@ -70,7 +72,6 @@
7072
"karma-typescript": "^5.0.1",
7173
"nyc": "^15.0.0",
7274
"prettier": "^2.0.2",
73-
"tap-prettify": "^0.0.2",
7475
"tape": "^4.13.2",
7576
"ts-node": "^8.8.1",
7677
"tslint": "^5.18.0",

tsconfig.browser.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist.browser",
5+
},
6+
"target": "es5",
7+
"module": "es2015",
8+
"moduleResolution": "node",
9+
"lib": ["es2016", "dom", "es5"]
10+
}
11+

tsconfig.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"extends": "@ethereumjs/config-tsc",
3+
"compilerOptions": {
4+
"outDir": "./dist"
5+
},
36
"include": ["src/**/*.ts"],
7+
"target": "ES2017"
48
}

tsconfig.prod.json

-7
This file was deleted.

0 commit comments

Comments
 (0)