12345678910111213141516171819202122232425262728 |
- import { defineConfig } from "vite";
- import path from "path";
- import uni from "@dcloudio/vite-plugin-uni";
- // https://vitejs.dev/config/
- export default defineConfig(({ mode, command }) => {
- return {
- base: "./", // 打包路径
- server: {
- hmr: true, //热更新
- host: true, //指定服务器
- open: true, //自动打开浏览器
- port: 8080, //启动端口
- },
- plugins: [uni()],
- resolve: {
- alias: {
- "@/": path.resolve(__dirname, "src"),
- "@/static": path.resolve(__dirname, "src/static"),
- "@/utils": path.resolve(__dirname, "src/utils"),
- },
- },
- configureWebpack: {
- externals: {
- AMap: "AMap",
- },
- },
- };
- });
|