Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

1.0 KB
Raw Blame
import path from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import mdx from '@mdx-js/rollup';
import remarkGfm from 'remark-gfm';
import rehypeShiki from '@shikijs/rehype';
import { docsPlugin } from './build/docsPlugin.ts';
import { notFoundPage } from './build/notFoundPage.ts';

export default defineConfig({
  plugins: [
    // MDX must compile before the React plugin transforms the result
    {
      enforce: 'pre',
      ...mdx({
        providerImportSource: '@mdx-js/react',
        remarkPlugins: [remarkGfm],
        // both themes are written as CSS variables; index.css picks one by data-theme
        rehypePlugins: [[rehypeShiki, { themes: { light: 'github-light', dark: 'github-dark' }, defaultColor: false }]],
      }),
    },
    react({ include: /\.(mdx|tsx|ts)$/ }),
    tailwindcss(),
    docsPlugin(path.resolve(__dirname, 'content/docs')),
    notFoundPage(),
  ],
  resolve: {
    alias: { '@': path.resolve(__dirname, './src') },
  },
});