Skip to content

Commit

Permalink
TinaCMS content update
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Neoh <[email protected]>
  • Loading branch information
tina-cloud-app[bot] and Ben0189 authored Dec 20, 2024
1 parent 8be29db commit 37e8df7
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion content/docs/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,39 @@ export default defineConfig({
```

In this example, the TinaCMS admin will be viewable at `<my-site-url>/admin/index.html`.
For more information [check out the content modeling section](/docs/schema/).
For more information [check out the content modeling section](/docs/schema/).\
\


## Typescript Path Alias

TinaCMS supports typeScript path aliases in the tina.config.js file and collections, making it easier to organize and maintain your code.

##### Use alias in config.ts

Ensure that tsconfig.json exists at the root of your project. Define your aliases in the compilerOptions section:

```json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
```

Figure: Your defined tsconfig.json

You can now import utilities or other modules using the aliases:

```typescript
import { someUtility } from '@/lib/utils';

export default defineConfig({
....
})
```

Figure: Using aliases in tina config.ts

0 comments on commit 37e8df7

Please sign in to comment.