@@ -6,17 +6,40 @@ import tailwindcss from '@tailwindcss/vite'
66
77// https://vitejs.dev/config/
88export default defineConfig ( {
9- plugins : [ TanStackRouterVite ( { autoCodeSplitting : true } ) , viteReact ( ) , tailwindcss ( ) ] ,
9+ plugins : [ TanStackRouterVite ( { autoCodeSplitting : false } ) , viteReact ( ) , tailwindcss ( ) ] ,
1010 test : {
1111 globals : true ,
1212 environment : "jsdom" ,
1313 } ,
14+
15+ // This is to ensure we can import the bus module from the bus folder and have nice import paths
1416 resolve : {
1517 alias : {
1618 '@' : resolve ( __dirname , './src' ) ,
1719 '@bus' : resolve ( __dirname , '../bus/src' ) ,
1820 } ,
1921 } ,
22+
23+ // This is to ensure that the assets are in the assets folder are all named assets/[name].[extension] rather
24+ // than having a hash.
25+ build : {
26+ // Everything below is pure Rollup syntax
27+ rollupOptions : {
28+ output : {
29+ // ── JavaScript ──────────────────────────────────────
30+ entryFileNames : 'assets/[name].js' , // main-entry
31+ chunkFileNames : 'assets/[name].js' , // code-splits
32+ // ── CSS & other assets ─────────────────────────────
33+ assetFileNames : ( { name } ) => {
34+ // name = original file name with extension
35+ const ext = name ?. substring ( name . lastIndexOf ( '.' ) )
36+ return `assets/[name]${ ext } ` // e.g. style.css
37+ } ,
38+ } ,
39+ } ,
40+ } ,
41+
42+ // This ensures that the API calls to the server are proxied to the server.
2043 server : {
2144 proxy : {
2245 '/api' : {
0 commit comments