diff --git a/MyApp.Client/package.json b/MyApp.Client/package.json index 0e41b0b..2132470 100644 --- a/MyApp.Client/package.json +++ b/MyApp.Client/package.json @@ -20,7 +20,6 @@ "classnames": "^2.5.1", "clsx": "^2.1.1", "gray-matter": "^4.0.3", - "lucide-react": "^0.510.0", "react": "^19.1.0", "react-dom": "^19.1.0", "react-router": "^7.6.0", @@ -37,18 +36,19 @@ "@tailwindcss/typography": "^0.5.16", "@tailwindcss/vite": "^4.1.6", "@types/mdx": "^2.0.13", - "@types/node": "^22.15.17", + "@types/node": "^24.10.0", "@types/react": "^19.1.4", "@types/react-dom": "^19.1.5", "@types/react-helmet": "^6.1.11", "@types/remark-prism": "^1.3.7", "@typescript-eslint/eslint-plugin": "^8.32.1", "@typescript-eslint/parser": "^8.32.1", - "@vitejs/plugin-react": "^4.4.1", + "@vitejs/plugin-react": "^5.1.0", "autoprefixer": "^10.4.21", "eslint": "^9.26.0", - "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-refresh": "^0.4.20", + "lucide-react": "^0.552.0", "postcss": "^8.5.3", "rehype-raw": "^7.0.0", "rehype-stringify": "^10.0.1", @@ -59,7 +59,7 @@ "remark-prism": "^1.3.6", "tailwindcss": "^4.1.6", "typescript": "^5.8.3", - "vite": "^6.3.5", + "vite": "^7.2.1", "vite-plugin-pages": "^0.33.0", "vite-plugin-press": "^1.0.10", "vite-plugin-svgr": "^4.3.0" diff --git a/MyApp.Client/vite.config.ts b/MyApp.Client/vite.config.ts index 09c56a7..36e5c8e 100644 --- a/MyApp.Client/vite.config.ts +++ b/MyApp.Client/vite.config.ts @@ -36,31 +36,36 @@ if (!certificateName) { const certFilePath = path.join(baseFolder, `${certificateName}.pem`); const keyFilePath = path.join(baseFolder, `${certificateName}.key`); -console.log(`Certificate path: ${certFilePath}`); +// Only generate certificates for dev server, not for build +const isDevServer = !process.argv.includes('build'); -if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) { +if (isDevServer) { + console.log(`Certificate path: ${certFilePath}`); - // mkdir to fix dotnet dev-certs error 3 https://github.com/dotnet/aspnetcore/issues/58330 - if (!fs.existsSync(baseFolder)) { - fs.mkdirSync(baseFolder, { recursive: true }); - } - if ( - 0 !== - child_process.spawnSync( - "dotnet", - [ - "dev-certs", - "https", - "--export-path", - certFilePath, - "--format", - "Pem", - "--no-password", - ], - { stdio: "inherit" } - ).status - ) { - throw new Error("Could not create certificate."); + if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) { + + // mkdir to fix dotnet dev-certs error 3 https://github.com/dotnet/aspnetcore/issues/58330 + if (!fs.existsSync(baseFolder)) { + fs.mkdirSync(baseFolder, { recursive: true }); + } + if ( + 0 !== + child_process.spawnSync( + "dotnet", + [ + "dev-certs", + "https", + "--export-path", + certFilePath, + "--format", + "Pem", + "--no-password", + ], + { stdio: "inherit" } + ).status + ) { + throw new Error("Could not create certificate."); + } } } @@ -100,7 +105,7 @@ export default defineConfig(async () => { tailwindcss(), Press({ baseUrl, - //Uncomment to generate metadata *.json + //Uncomment to generate metadata *.json //metadataPath: './public/api', }), ], @@ -109,6 +114,9 @@ export default defineConfig(async () => { '@': fileURLToPath(new URL('./src', import.meta.url)), } }, + build: { + target: 'baseline-widely-available', + }, server: { proxy: { '^/api': { @@ -117,10 +125,12 @@ export default defineConfig(async () => { } }, port: 5173, - https: { - key: fs.readFileSync(keyFilePath), - cert: fs.readFileSync(certFilePath), - } + ...(fs.existsSync(keyFilePath) && fs.existsSync(certFilePath) ? { + https: { + key: fs.readFileSync(keyFilePath), + cert: fs.readFileSync(certFilePath), + } + } : {}) } } })