mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 14:55:45 +00:00
Former-commit-id: ac12fdf3efe5d8947a768ddde7edad13fcdac487 [formerly fa5dc0b809a1f78d05a10cd92b973acc4d8a3241] [formerly ecfe8e86a78c6b6586a82d56183b456eb2ee7936 [formerly 23c0cb11df48695939b2110a0407f17da6c09feb]] Former-commit-id: b3f448110de3e72fff3242d52597497887e4611d [formerly b4c2a73fc0151c7de62bfe196c8ba30aee01b0bc] Former-commit-id: c11621e9b83af8023e69ed2826cbb0881be9205d
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import mdx from '@mdx-js/rollup'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'node:path'
|
|
import rehypeHighlight from 'rehype-highlight'
|
|
import remarkGfm from 'remark-gfm'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const options = {
|
|
remarkPlugins: [remarkGfm],
|
|
rehypePlugins: [rehypeHighlight]
|
|
}
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), mdx(options), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src')
|
|
}
|
|
},
|
|
build: {
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true
|
|
},
|
|
target: 'esnext',
|
|
sourcemap: false,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
return id
|
|
.toString()
|
|
.split('node_modules/')
|
|
.pop()!
|
|
.split('/')[0]
|
|
.toString()
|
|
} else if (id.endsWith('.mdx')) {
|
|
const mdxPath = id.toString().split('src/')[1]
|
|
return `mdx-${mdxPath.replace(/\//g, '-').replace('.mdx', '')}`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
sourcemap: false,
|
|
target: 'esnext'
|
|
}
|
|
}
|
|
})
|