📄 tanstack/config/latest/docs/package-structure

File: package-structure.md | Updated: 11/15/2025

Source: https://tanstack.com/config/latest/docs/package-structure



TanStack

Config v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Version

Latest

Search...

+ K

Menu

Getting Started

Utilities

Conventions

Version

Latest

Menu

Getting Started

Utilities

Conventions

On this page

Package Structure

Copy Markdown

The following structure ensures packages work optimally with our monorepo/Nx workflow.

### ./package.json

  • All TanStack projects have "type": "module" to set the default resolution of .js files to ESM; this does not have any impact on building for CJS
  • It is also essential to have an "exports" field
  • For legacy reasons, you should also include the "main", "module", and "types" fields
  • All packages have the following scripts which are cached by Nx: "test:eslint", "test:types", "test:lib", "build", "test:build"

### ./tsconfig.json

  • Extends the root-level tsconfig (e.g. "extends": "../../tsconfig.json")
  • Add any framework-specific options and included files here

### ./vite.config.ts

### ./src

  • This folder should only include code which gets built and shipped to users
  • Tests should not be placed in this folder, as they bloat the shipped code, and can unintentionally invalidate the Nx cache

### ./tests

  • This folder should include all test files
  • It should also include any test setup files required by that framework

Edit on GitHub

CI/CD

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey