cankao-h5/vite.config.ts

46 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-08-10 16:44:02 +08:00
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
base: "/jnh/",
2025-08-10 16:44:02 +08:00
plugins: [uni()],
css: {
2025-08-10 16:44:02 +08:00
preprocessorOptions: {
scss: {
additionalData: `
@import "@/assets/style/variable.scss";
`,
},
},
2025-08-10 16:44:02 +08:00
},
2025-08-10 16:44:02 +08:00
server: {
host: "0.0.0.0",
port: 8881,
// proxy: {
// "/mini": {
// target: "https://cankao.cs.com.cn",
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/mini/, ""),
// },
// },
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
redirect: resolve(__dirname, "redirect.html"),
},
},
},
define: {
__VUE_I18N_LEGACY_API__: JSON.stringify(false),
__VUE_I18N_FULL_INSTALL__: JSON.stringify(false),
__INTLIFY_PROD_DEVTOOLS__: JSON.stringify(false),
__NEXT_VERSION__: JSON.stringify(process.env.npm_package_version),
__NEXT_NAME__: JSON.stringify(process.env.npm_package_name),
},
});