Open History to see the last commit
1---
2id: publish
3title: Publish
4---
5
6## Usage
7
8To use the TanStack Config programmatically, you can import the `publish` function:
9
10```ts
11import { publish } from '@tanstack/config/publish'
12// OR
13import { publish } from '@tanstack/publish-config'
14
15publish({
16 branchConfigs: configOpts.branchConfigs,
17 packages: configOpts.packages,
18 rootDir: configOpts.rootDir,
19 branch: process.env.BRANCH,
20 tag: process.env.TAG,
21 ghToken: process.env.GH_TOKEN,
22})
23 .then(() => {
24 console.log('Successfully published packages!')
25 })
26 .catch(console.error)
27```
28
29> The programmatic usage is only available for ESM packages. To support this, you have to have:
30>
31> ```json
32> {
33> "type": "module"
34> }
35> ```
36>
37> in your `package.json` file and use `import` instead of `require`.