feat: Update Vite configuration and add new public routes
- Refactored vite.config.ts to update entry points and improve plugin configuration. - Added Home.vue as the landing page with a modern design and features overview. - Created Layout.vue for consistent header and footer across public routes. - Implemented Privacy.vue and Terms.vue for legal documentation with structured content. - Introduced gRPC and service index files for future service implementations. - Developed createVueApp.ts for application setup with PrimeVue and Pinia. - Enhanced SSR rendering in ssrRender.ts for improved performance and SEO.
This commit is contained in:
121
vite.config.ts
121
vite.config.ts
@@ -1,4 +1,3 @@
|
||||
import { cloudflare } from "@cloudflare/vite-plugin";
|
||||
import { PrimeVueResolver } from "@primevue/auto-import-resolver";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
@@ -10,66 +9,66 @@ import { defineConfig } from "vite";
|
||||
import ssrPlugin from "./plugins/ssrPlugin";
|
||||
import { vitePluginSsrMiddleware } from "./plugins/vite-plugin-ssr-middleware";
|
||||
export default defineConfig((env) => {
|
||||
// console.log("env:", env, import.meta.env);
|
||||
return {
|
||||
plugins: [
|
||||
unocss(),
|
||||
vue(),
|
||||
vueJsx(),
|
||||
AutoImport({
|
||||
imports: ["vue", "vue-router", "pinia"], // Common presets
|
||||
dts: true, // Generate TypeScript declaration file
|
||||
}),
|
||||
Components({
|
||||
dirs: ["src/components"],
|
||||
extensions: ["vue", "tsx"],
|
||||
dts: true,
|
||||
dtsTsx: true,
|
||||
directives: false,
|
||||
resolvers: [PrimeVueResolver()],
|
||||
}),
|
||||
ssrPlugin(),
|
||||
vitePluginSsrMiddleware({
|
||||
entry: "src/index.tsx",
|
||||
preview: path.resolve("dist/server/index.js"),
|
||||
})
|
||||
// devServer({
|
||||
// entry: 'src/index.tsx',
|
||||
// }),
|
||||
// cloudflare(),
|
||||
],
|
||||
environments: {
|
||||
client: {
|
||||
build: {
|
||||
outDir: "dist/client",
|
||||
rollupOptions: {
|
||||
input: { index: "/src/client.ts" },
|
||||
},
|
||||
}
|
||||
},
|
||||
server: {
|
||||
build: {
|
||||
outDir: "dist/server",
|
||||
copyPublicDir: false,
|
||||
rollupOptions: {
|
||||
input: { index: "/src/index.tsx" },
|
||||
},
|
||||
// console.log("env:", env, import.meta.env);
|
||||
return {
|
||||
plugins: [
|
||||
unocss(),
|
||||
vue(),
|
||||
vueJsx(),
|
||||
AutoImport({
|
||||
imports: ["vue", "vue-router", "pinia"], // Common presets
|
||||
dts: true, // Generate TypeScript declaration file
|
||||
}),
|
||||
Components({
|
||||
dirs: ["src/components"],
|
||||
extensions: ["vue", "tsx"],
|
||||
dts: true,
|
||||
dtsTsx: true,
|
||||
directives: false,
|
||||
resolvers: [PrimeVueResolver()],
|
||||
}),
|
||||
ssrPlugin(),
|
||||
vitePluginSsrMiddleware({
|
||||
entry: "src/main.ts",
|
||||
preview: path.resolve("dist/server/index.js"),
|
||||
}),
|
||||
// devServer({
|
||||
// entry: 'src/index.tsx',
|
||||
// }),
|
||||
// cloudflare(),
|
||||
],
|
||||
environments: {
|
||||
client: {
|
||||
build: {
|
||||
outDir: "dist/client",
|
||||
rollupOptions: {
|
||||
input: { index: "/src/client.ts" },
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
build: {
|
||||
outDir: "dist/server",
|
||||
copyPublicDir: false,
|
||||
rollupOptions: {
|
||||
input: { index: "/src/main.ts" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
// "httpClientAdapter": path.resolve(__dirname, "./src/api/httpClientAdapter.server.ts")
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ["vue"],
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
// "httpClientAdapter": path.resolve(__dirname, "./src/api/httpClientAdapter.server.ts")
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ["vue"],
|
||||
},
|
||||
|
||||
ssr: {
|
||||
// external: ["vue"]
|
||||
// noExternal: ["vue"],
|
||||
},
|
||||
};
|
||||
ssr: {
|
||||
// external: ["vue"]
|
||||
// noExternal: ["vue"],
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user