Socket
Socket
Sign inDemoInstall

@typedash/tsconfig

Package Overview
Dependencies
1
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @typedash/tsconfig

Shared TypeScript Configuration


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
2
Install size
3.68 kB
Created
Weekly downloads
 

Readme

Source

@typedash/tsconfig

Centralized and shared TypeScript configuration.

Install

npm install --save-dev @typedash/tsconfig
yarn add --dev @typedash/tsconfig

Usage: Monorepo

If you're consuming this package from inside the monorepo, then we can leverage a root level configuration (that extends this package's tsconfig) that adds paths. This allows for any package in the monorepo to perform a build without building all the sibling dependencies first! This is accomplished via the paths configuration that maps @typedash to sibling src directories (instead of the dist).

tsconfig.json

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist/esm"
  },
  "include": ["./src"]
}

If you intend on publishing your project/package, you should also include a cjs configuration to emit both esm and commonjs.

tsconfig.cjs.json

{
  "extends": "../../tsconfig.cjs.json",
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist/cjs"
  },
  "include": ["./src"]
}

NOTE: Don't forget to add local path "references" to the sibling packages you depend on. See the README.md at the root of this monorepo for more information.

Usage: External Project

Configuration for usage outside the monorepo is exactly the same, except you'll refer to this package directly. Here's the normal usage for a project that doesn't intend on publishing consumable assets.

tsconfig.json

{
  "extends": "@typedash/tsconfig/tsconfig.json",
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist/esm"
  },
  "include": ["./src"]
}

If you intend on publishing your project/package, you should also include a cjs configuration to emit both esm and commonjs.

tsconfig.cjs.json

{
  "extends": "@typedash/tsconfig/tsconfig.cjs.json",
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist/cjs"
  },
  "include": ["./src"]
}

FAQs

Last updated on 28 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc