北斗天云官网管理系统后端接口
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

59 Zeilen
1.4KB

  1. import vue from "@vitejs/plugin-vue";
  2. import { resolve } from "path";
  3. import { defineConfig, loadEnv, UserConfig, UserConfigExport } from "vite";
  4. import html from "vite-plugin-html";
  5. import tsconfigPaths from "vite-tsconfig-paths";
  6. import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
  7. export default (config: UserConfig): UserConfigExport => {
  8. const mode = config.mode as string;
  9. return defineConfig({
  10. base: "./",
  11. plugins: [
  12. vue(),
  13. html({
  14. inject: {
  15. injectData: {
  16. apiURL: loadEnv(mode, process.cwd()).VITE_APP_API,
  17. title: ""
  18. }
  19. },
  20. minify: true
  21. }),
  22. tsconfigPaths(),
  23. createSvgIconsPlugin({
  24. iconDirs: [resolve(__dirname, "src/assets/icons/svg")],
  25. symbolId: "icon-[dir]-[name]"
  26. })
  27. ],
  28. build: {
  29. chunkSizeWarningLimit: 1024,
  30. commonjsOptions: {
  31. include: /node_modules|lib/
  32. },
  33. rollupOptions: {
  34. output: {
  35. manualChunks: {
  36. quill: ["quill"],
  37. lodash: ["lodash"],
  38. vlib: ["vue", "vue-router", "element-plus"]
  39. }
  40. }
  41. }
  42. },
  43. resolve: {
  44. alias: {
  45. // 配置别名
  46. "@": resolve(__dirname, "./src")
  47. }
  48. },
  49. server: {
  50. open: true, // 自动启动浏览器
  51. host: "0.0.0.0", // localhost
  52. port: 8001, // 端口号
  53. https: false,
  54. hmr: true
  55. }
  56. });
  57. };