Skip to content

Commit

Permalink
Merge branch 'main' into type-check
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jan 3, 2024
2 parents 4d39f94 + e55ce49 commit 91534f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,25 @@ The build config is quite opinionated, as it is designed to work with our intern

## vite.config.ts

- Wrap your `defineConfig` in `mergeConfig` (also exported from Vite).
- Add `tanstackBuildConfig` into `mergeConfig`.
- Note: Please avoid modifying `build` in your own `defineConfig`.
- Import `mergeConfig` and `tanstackBuildConfig`.
- Merge your custom config first, followed by `tanstackBuildConfig`.
- Please avoid modifying `build` in your custom config.
- See an example below:

```ts
import { defineConfig, mergeConfig } from 'vite'
import { tanstackBuildConfig } from '@tanstack/config/build'

const config = defineConfig({
// Framework plugins, vitest config, etc.
})

export default mergeConfig(
config,
tanstackBuildConfig({
entry: 'src/index.ts',
srcDir: 'src',
}),
defineConfig({
// Add any custom options here, such as framework plugins
}),
)
```

Expand Down

0 comments on commit 91534f0

Please sign in to comment.