aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vite.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vite.config.ts')
-rw-r--r--vite.config.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..d649999
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,28 @@
+import react from '@vitejs/plugin-react'
+import { defineConfig } from 'vite'
+
+// https://vite.dev/config/
+export default defineConfig({
+ plugins: [react()],
+ build: {
+ rolldownOptions: {
+ output: {
+ codeSplitting: {
+ // Do not pull a group's dependencies into that group. React and the
+ // router must stay in their own cacheable chunks.
+ includeDependenciesRecursively: false,
+ groups: [
+ {
+ name: 'react-vendor',
+ test: /node_modules[\\/](react|react-dom|scheduler)[\\/]/,
+ },
+ {
+ name: 'router-vendor',
+ test: /node_modules[\\/]react-router(-dom)?[\\/]/,
+ },
+ ],
+ },
+ },
+ },
+ },
+})