Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

vite.config.ts

27 lines684 Bytes

1import { defineConfig } from 'vite'
2import solid from 'vite-plugin-solid'
3import { tanstackRouter } from '@tanstack/router-plugin/vite'
4import tailwindcss from '@tailwindcss/vite'
5​
6// https://vitejs.dev/config/
7export default defineConfig({
8 plugins: [
9 tailwindcss(),
10 tanstackRouter({
11 target: 'solid',
12 autoCodeSplitting: true,
13 codeSplittingOptions: {
14 splitBehavior: ({ routeId }) => {
15 if (routeId === '/posts') {
16 return [
17 ['loader'],
18 ['component'],
19 ['pendingComponent', 'notFoundComponent', 'errorComponent'],
20 ]
21 }
22 },
23 },
24 }),
25 solid(),
26 ],
27})