# vite.config.ts

> 12 lines of code and 0 definitions.

Tree: Bane's Lab Social Share
Language: typescript
Canonical: https://banes-lab.com/anatomy/social-share#file-social-share-vite-config-ts
Source text: https://banes-lab.com/source/social-share/vite.config.ts.txt

Listed in [Bane's Lab Social Share](https://banes-lab.com/api/source/social-share.md), after [tsconfig.json](https://banes-lab.com/source/social-share/tsconfig.json.md) and before [tsconfig.base.json](https://banes-lab.com/source/social-share/tsconfig.base.json.md).

## Contained in

- [root](https://banes-lab.com/anatomy/social-share/folder-social-share.md)

## Source

```typescript
import { STAGE_MODE } from "#configuration/constants/card.constants";
import { absolutePath } from "@ssot/paths";
import { defineConfig } from "vite";
import { devCertificate } from "@banes-lab/build-scripts/core/factories/certificate.factory.ts";
import { devPortPlugin } from "@banes-lab/build-scripts/core/plugins/server.plugin.ts";

export default defineConfig(async ({ mode }) => ({
    cacheDir: absolutePath("viteCache.social"),
    plugins: mode === STAGE_MODE ? [] : [devPortPlugin("SOCIAL_DEV_PORT")],
    publicDir: absolutePath("app.public"),
    root: absolutePath("app.social"),
    server: { https: await devCertificate(), strictPort: true, watch: mode === STAGE_MODE ? null : {} },
}));
```
