From e21020e5aa0281085ad397fce7fcbc596f628e8f Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Fri, 18 Apr 2025 04:32:27 -0400 Subject: [PATCH] Enhance Vite configuration with Rollup options for output file naming and add JSON stringification. Update web.config to serve .js and .mjs files with the correct MIME type. --- frontend/vite.config.js | 13 ++++++++++++- frontend/web.config | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 5b6c9f2..2539025 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -21,7 +21,15 @@ export default defineConfig(({mode}) => { host: 'localhost', }, build: { - sourcemap: true // Enable source maps for debugging + sourcemap: true, // Enable source maps for debugging + rollupOptions: { + output: { + format: 'es', + entryFileNames: '[name].[hash].js', + chunkFileNames: '[name].[hash].js', + assetFileNames: '[name].[hash].[ext]' + } + } }, resolve: { alias: { @@ -32,6 +40,9 @@ export default defineConfig(({mode}) => { // Define a global constant __APP_ENV__ based on loaded environment variables VITE_API_URL: JSON.stringify(env.VITE_API_URL), VITE_STRIPE_API_KEY: JSON.stringify(env.VITE_STRIPE_API_KEY) + }, + json: { + stringify: true } } }) diff --git a/frontend/web.config b/frontend/web.config index 23aeb88..dee7053 100644 --- a/frontend/web.config +++ b/frontend/web.config @@ -3,6 +3,13 @@ + + + + + + + \ No newline at end of file