diff --git a/.gitignore b/.gitignore index 206a4c0..33bde9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ package-lock.json node_modules -dist/ +dist +dist.browser .nyc_output coverage diff --git a/.prettierignore b/.prettierignore index d697df1..c44d619 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ node_modules .vscode package.json dist +dist.browser .nyc_output *.json docs diff --git a/package.json b/package.json index 680e473..5bdc6d3 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,16 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ - "dist/**/*" + "dist", + "dist.browser" ], + "browser": "dist.browser/index.js", "scripts": { "benchmarks": "npm run build && ts-node benchmarks/index.ts", - "build": "ethereumjs-config-build", + "build": "tsc -p tsconfig.json && tsc -p tsconfig.browser.json", "prepublishOnly": "npm run test && npm run build", "coverage": "nyc --reporter=lcov npm run test:node", - "docs:build": "npx typedoc", + "docs:build": "typedoc", "lint": "ethereumjs-config-lint", "lint:fix": "ethereumjs-config-lint-fix", "format": "ethereumjs-config-format", diff --git a/tsconfig.browser.json b/tsconfig.browser.json new file mode 100644 index 0000000..a6e9b2c --- /dev/null +++ b/tsconfig.browser.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist.browser", + }, + "target": "es5", + "lib": ["dom", "es5"] +} + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 4782753..bf015d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,8 @@ { "extends": "@ethereumjs/config-tsc", + "compilerOptions": { + "outDir": "./dist" + }, "include": ["src/**/*.ts"], + "target": "ES2017" } diff --git a/tsconfig.prod.json b/tsconfig.prod.json deleted file mode 100644 index 184d95b..0000000 --- a/tsconfig.prod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@ethereumjs/config-tsc", - "compilerOptions": { - "outDir": "./dist" - }, - "include": ["src/**/*.ts"] -}