Skip to content

Commit 10b6fb3

Browse files
committed
fix(skeleton): update vite config for vite v8
1 parent 6dcbfa7 commit 10b6fb3

2 files changed

Lines changed: 35 additions & 30 deletions

File tree

skeleton/package.json.liquid

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"rollup-plugin-visualizer": "^7.0.1",
1717
"typescript": "^5.9.3",
1818
"vite": "^8.0.0",
19-
"vite-plugin-hashed-favicons": "2.0.6",
20-
"vite-tsconfig-paths": "^6.1.1"
19+
"vite-plugin-hashed-favicons": "2.0.7"
2120
},
2221
"dependencies": {
2322
{%- if features contains "auth0" %}

skeleton/vite.config.ts.liquid

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import react from "@vitejs/plugin-react-swc";
1+
import react from "@vitejs/plugin-react";
22
import { visualizer } from "rollup-plugin-visualizer";
33
import { defineConfig } from "vite";
44
import favicons from "vite-plugin-hashed-favicons";
5-
import tsconfigPaths from "vite-tsconfig-paths";
65
import TanStackRouterVite from "@tanstack/router-plugin/vite";
76

87
export 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

Comments
 (0)