single-spa TypeScript Configuration

3.0.0 · active · verified Sun Apr 19

ts-config-single-spa provides a foundational TypeScript configuration preset designed specifically for projects within the single-spa microfrontend ecosystem. Currently at version 3.0.0, this package aims to standardize `tsconfig.json` settings, ensuring compatibility and best practices across various microfrontends. It handles common configurations such as `target`, `module`, `jsx` support, and `moduleResolution`, which are critical for smooth integration in a polyglot microfrontend architecture. While there isn't a strict independent release cadence, it is part of the larger `create-single-spa` monorepo and updates are coordinated with other single-spa tooling, ensuring ongoing relevance and support. Its key differentiator is simplifying TypeScript setup for single-spa, minimizing boilerplate, and reducing common configuration pitfalls associated with module interoperation and shared dependencies in a microfrontend environment.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic `tsconfig.json` file extending `ts-config-single-spa` for a microfrontend, including common compiler options and file inclusions.

{
  "extends": "ts-config-single-spa",
  "compilerOptions": {
    "jsx": "react-jsx", // Adjust based on your framework (e.g., "preserve", "react", "vue-jsx")
    "lib": ["dom", "es2020"],
    "baseUrl": ".",
    "paths": {
      "*": ["src/*"]
    },
    "declaration": true, // Often desired for microfrontends exporting modules
    "outDir": "dist"
  },
  "include": ["src/**/*.ts", "src/**/*.tsx"],
  "exclude": ["node_modules", "dist"]
}

view raw JSON →