diff --git a/vite.config.ts b/vite.config.ts index 3df716f..3cb6598 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,23 +4,25 @@ import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react()], - server: { - host: '0.0.0.0', - port: 5173, - https: - process.env.VITE_MODE === 'production' - ? {} - : { - key: fs.readFileSync(path.resolve('./cert', 'localhost-key.pem')), - cert: fs.readFileSync(path.resolve('./cert', 'localhost.pem')), - }, - }, - define: { - global: {}, - }, - build: { - chunkSizeWarningLimit: 1600, - }, +export default defineConfig(({ mode }) => { + return { + plugins: [react()], + server: { + host: '0.0.0.0', + port: 5173, + https: + mode === 'production' + ? {} + : { + key: fs.readFileSync(path.resolve('./cert', 'localhost-key.pem')), + cert: fs.readFileSync(path.resolve('./cert', 'localhost.pem')), + }, + }, + define: { + global: {}, + }, + build: { + chunkSizeWarningLimit: 1600, + }, + }; });