1- import react from "@vitejs/plugin-react-swc ";
1+ import react from "@vitejs/plugin-react";
22import { visualizer } from "rollup-plugin-visualizer";
33import { defineConfig } from "vite";
44import favicons from "vite-plugin-hashed-favicons";
5- import tsconfigPaths from "vite-tsconfig-paths";
65import TanStackRouterVite from "@tanstack/router-plugin/vite";
76
87export default defineConfig({
@@ -24,44 +23,51 @@ export default defineConfig({
2423 },
2524 }),
2625 react(),
27- tsconfigPaths(),
2826 visualizer(),
2927 favicons("./src/assets/favicon.svg"),
3028 ],
29+ resolve: {
30+ tsconfigPaths: true,
31+ },
3132 build: {
3233 sourcemap: true,
33- rollupOptions : {
34+ rolldownOptions : {
3435 output: {
35- manualChunks: {
36- react: ["react", "react-dom", "@tanstack/react-router", "material-ui-confirm"],
37- mui: [
38- "@mui/material",
39- "@mui/icons-material",
40- "material-ui-popup-state",
41- "@emotion/react",
42- "@emotion/styled",
36+ codeSplitting: {
37+ groups: [
38+ {
39+ name: "react",
40+ test: /node_modules[\\/](react|react-dom|@tanstack[\\/]react-router)[\\/]/,
41+ },
42+ {
43+ name: "mui",
44+ test: /node_modules[\\/](@mui|material-ui-confirm|material-ui-popup-state|@emotion|notistack)/,
45+ },
46+ {
47+ name: "query",
48+ test: /node_modules[\\/](@tanstack[\\/]react-query|@jsonapi-serde)/,
49+ },
50+ {
51+ name: "form",
52+ test: /node_modules[\\/](react-hook-form|@hookform|mui-rhf-integration)/,
53+ },
54+ {
55+ name: "zod",
56+ test: /node_modules[\\/]zod/,
57+ },
58+ {%- if features contains "auth0" %}
59+ {
60+ name: "auth",
61+ test: /node_modules[\\/]@auth0/,
62+ },
63+ {%- endif %}
4364 ],
44- notistack: ["notistack"],
45- query: ["@tanstack/react-query", "@jsonapi-serde/client"],
46- form: ["react-hook-form", "@hookform/resolvers", "mui-rhf-integration"],
47- temporal: ["temporal-polyfill"],
48- zod: ["zod", "zod-temporal"],
49- {%- if features contains "auth0" %}
50- auth: ["@auth0/auth0-react"],
51- {%- endif %}
5265 },
5366 },
54- // @see https://github.com/vitejs/vite/issues/15012
55- onwarn(warning, defaultHandler) {
56- if (warning.code === 'SOURCEMAP_ERROR') {
57- return;
58- }
59-
60- defaultHandler(warning)
61- },
6267 },
6368 },
6469 server: {
6570 port: 3010,
6671 },
6772});
73+
0 commit comments