PozoAppOptimUpdated/vite.config.js

107 lines
2.7 KiB
JavaScript
Raw Normal View History

2025-11-05 17:52:07 +05:30
// import { defineConfig } from "vite";
// import react from "@vitejs/plugin-react";
// import sitemap from "vite-plugin-sitemap";
// export default defineConfig(({ mode }) => {
// const isProd = mode === "production";
// return {
// plugins: [
// react(),
// isProd &&
// sitemap({
// hostname: "https://pozo.app",
// routes: ["/", "/signin", "/signup", "/dashboard", "/features", "/pricing", "/contact-us", "/blog"],
// }),
// ],
// base: "/home/",
// envDir: "src",
// envPrefix: "ENV_",
// build: {
// chunkSizeWarningLimit: 1000,
// rollupOptions: {
// output: {
// manualChunks: {
// vendor: ['react', 'react-dom'],
// editor: ['@editorjs/editorjs', '@editorjs/header', '@editorjs/image', '@editorjs/list', '@editorjs/paragraph', '@editorjs/code', '@editorjs/embed', '@editorjs/link', '@editorjs/quote']
// }
// }
// }
// },
// server: {
// host: "192.168.1.68",
// port: process.env.PORT || 3000,
// },
// optimizeDeps: {
// exclude: ["console.log"],
// include: [
// "@editorjs/editorjs",
// "@editorjs/header",
// "@editorjs/image",
// "@editorjs/list",
// "@editorjs/paragraph",
// "@editorjs/code",
// "@editorjs/embed",
// "@editorjs/link",
// "@editorjs/quote",
// ],
// },
// };
// });
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { terser } from "rollup-plugin-terser";
// https://vitejs.dev/config/
export default defineConfig(({ command, mode, ssrBuild }) => {
if (mode == "production") {
return {
plugins: [
react(),
// terser({ // Add terser plugin for production
// compress: {
// drop_console: true, // This removes all console.* statements
// },
// }),
],
base: "/", // Changed from "/home/" to "/" for clean SEO URLs
2025-11-05 17:52:07 +05:30
envDir: "src",
envPrefix: "ENV_",
};
} else {
return {
plugins: [react()],
base: "/", // Changed from default to "/" for consistency
2025-11-05 17:52:07 +05:30
envDir: "src",
envPrefix: "ENV_",
server: {
host: "192.168.1.26",
port: process.env.PORT || 3001,
},
optimizeDeps: {
exclude: ["console.log"],
include: [
'@editorjs/editorjs',
'@editorjs/header',
'@editorjs/image',
'@editorjs/delimiter',
'@editorjs/list',
'@editorjs/paragraph'
]
},
};
}
});
// export default defineConfig({
// plugins: [react()],
// server: {
// host: '192.168.1.17',
// port: process.env.PORT || 3000,
// },
// });