vite.config.js 861 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { fileURLToPath, URL } from "node:url";
  2. import { defineConfig } from "vite";
  3. import vue from "@vitejs/plugin-vue";
  4. import AutoImport from "unplugin-auto-import/vite";
  5. import Components from "unplugin-vue-components/vite";
  6. import { VantResolver } from "@vant/auto-import-resolver";
  7. // https://vite.dev/config/
  8. export default defineConfig({
  9. base: "./",
  10. build: {
  11. rollupOptions: {
  12. input: {
  13. shell: fileURLToPath(new URL("./index.html", import.meta.url)),
  14. app: fileURLToPath(new URL("./app.html", import.meta.url)),
  15. },
  16. },
  17. },
  18. server: {
  19. host: "0.0.0.0",
  20. },
  21. plugins: [
  22. vue(),
  23. AutoImport({
  24. resolvers: [VantResolver()],
  25. }),
  26. Components({
  27. resolvers: [VantResolver()],
  28. }),
  29. ],
  30. resolve: {
  31. alias: {
  32. "@": fileURLToPath(new URL("./src", import.meta.url)),
  33. },
  34. },
  35. });