142 lines
3.8 KiB
JavaScript
142 lines
3.8 KiB
JavaScript
|
|
// 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(),
|
||
|
|
// // Disabled vite-plugin-sitemap to use manual sitemap.xml
|
||
|
|
// // isProd &&
|
||
|
|
// // sitemap({
|
||
|
|
// // hostname: "https://www.pozo.app",
|
||
|
|
// // routes: ["/home/", "/home/signin", "/home/blog", "/home/contact-us", "/home/pricing-pozoapp", "/home/live-Session"],
|
||
|
|
// // }),
|
||
|
|
// ],
|
||
|
|
// 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'],
|
||
|
|
// ui: ['antd'],
|
||
|
|
// utils: ['axios', 'moment', 'crypto-js']
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
// },
|
||
|
|
// minify: 'terser',
|
||
|
|
// terserOptions: {
|
||
|
|
// compress: {
|
||
|
|
// drop_console: true,
|
||
|
|
// drop_debugger: true
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
// },
|
||
|
|
// server: {
|
||
|
|
// host: "localhost",
|
||
|
|
// port: process.env.PORT || 3000,
|
||
|
|
// },
|
||
|
|
// preview: {
|
||
|
|
// host: "localhost",
|
||
|
|
// port: 4173,
|
||
|
|
// },
|
||
|
|
// 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
|
||
|
|
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",
|
||
|
|
],
|
||
|
|
ui: ["antd"],
|
||
|
|
utils: ["axios", "moment", "crypto-js"],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
minify: "terser",
|
||
|
|
terserOptions: {
|
||
|
|
compress: {
|
||
|
|
drop_console: true,
|
||
|
|
drop_debugger: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|
||
|
|
} else {
|
||
|
|
return {
|
||
|
|
plugins: [react()],
|
||
|
|
envDir: "src",
|
||
|
|
envPrefix: "ENV_",
|
||
|
|
|
||
|
|
server: {
|
||
|
|
host: "192.168.1.26",
|
||
|
|
port: process.env.PORT || 3000,
|
||
|
|
// host: "localhost",
|
||
|
|
// port: process.env.PORT || 3000,
|
||
|
|
},
|
||
|
|
optimizeDeps: {
|
||
|
|
exclude: ["console.log"],
|
||
|
|
|
||
|
|
include: [
|
||
|
|
"@editorjs/editorjs",
|
||
|
|
"@editorjs/header",
|
||
|
|
"@editorjs/image",
|
||
|
|
"@editorjs/delimiter",
|
||
|
|
"@editorjs/list",
|
||
|
|
"@editorjs/paragraph",
|
||
|
|
],
|
||
|
|
},
|
||
|
|
};
|
||
|
|
}
|
||
|
|
});
|