vite.config.js 663 B

1234567891011121314151617181920212223242526
  1. import { defineConfig } from "vite";
  2. import path from "path";
  3. import uni from "@dcloudio/vite-plugin-uni";
  4. // https://vitejs.dev/config/
  5. export default defineConfig(({ mode, command }) => {
  6. return {
  7. base: "./", // 打包路径
  8. server: {
  9. open: true, // 启动项目自动弹出浏览器
  10. port: 8080, // 启动端口
  11. },
  12. plugins: [uni()],
  13. resolve: {
  14. alias: {
  15. "@/": path.resolve(__dirname, "src"),
  16. "@/static": path.resolve(__dirname, "src/static"),
  17. "@/utils": path.resolve(__dirname, "src/utils"),
  18. },
  19. },
  20. configureWebpack: {
  21. externals: {
  22. AMap: "AMap",
  23. },
  24. },
  25. };
  26. });