Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Latest commit

 

History

History
60 lines (45 loc) · 1.09 KB

File metadata and controls

60 lines (45 loc) · 1.09 KB

@ethereumjs/config-typescript

Common TypeScript configuration for EthereumJS libraries.

Tool: TypeScript

Exposed CLI commands:

  • ethereumjs-config-ts-compile
  • ethereumjs-config-ts-build

Usage

Add tsconfig.json:

{
  "extends": "@ethereumjs/config-typescript/tsconfig.json",
  "include": ["src/**/*.ts", "test/**/*.ts"]
}

Add tsconfig.prod.json:

{
  "extends": "@ethereumjs/config-typescript/tsconfig.prod.json",
  "include": ["src/**/*.ts"]
}

Add tsconfig.browser.json:

{
  "extends": "@ethereumjs/config-typescript/tsconfig.browser.json",
  "include": ["src/**/*.ts"]
}

Use CLI commands above in your package.json:

  "scripts": {
    "tsc":   "ethereumjs-config-ts-compile",
    "build": "ethereumjs-config-ts-build"
  }

The default production target is ES2017. To support shipping the ES5 target for browsers, add to your package.json:

  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "browser": "dist.browser/index.js",
  "files": [
    "dist",
    "dist.browser"
  ]