Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 1.47 KB

File metadata and controls

77 lines (60 loc) · 1.47 KB

screeb-typescript-config

Screeb's typescript configs for frontend app.

Usage

Warning: This package is NOT published in the NPM registry and can't be installed using any package manager.

You may better clone the @screeb/template-lib if you have to build something with typescript/rollup.

Add config to your package:

npx lerna add @screeb/typescript-config --scope=<your-package>

In your tsconfig.json:

{
  // Mandatory
  "extends": "@screeb/typescript-config/src/tsconfig.json",

  // Recommended
  "include": ["src"],
  "exclude": ["dist"],
  "compilerOptions": {
    "outDir": "dist",
    "declaration": true,
    "declarationDir": "."
  }

  // [..]
}

In your package.json:

{
  // [..]

  // Mandatory
  "scripts": {
    "build": "rollup -c ../../node_modules/@screeb/typescript-config/src/rollup.config.js"
    // [..]
  },

  // Recommended
  "sideEffects": false,
  "type": "module",
  "module": "dist/es/index.mjs",
  "main": "dist/cjs/index.cjs",
  "jsnext:main": "dist/es/index.js",
  "types": "dist/es/index.d.ts",
  "files": ["dist"],
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": {
        "types": "./dist/cjs/index.d.ts",
        "default": "./dist/cjs/index.js"
      },
      "require": {
        "types": "./dist/es/index.d.ts",
        "default": "./dist/es/index.js"
      }
    }
  }

  // [..]
}

License

Released under MIT License.