vite.config.js 594 B

123456789101112131415161718192021222324
  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: [
  13. uni(),
  14. ],
  15. resolve: {
  16. alias: {
  17. "@/": path.resolve(__dirname, "src"),
  18. "@/static": path.resolve(__dirname, "src/static"),
  19. "@/utils": path.resolve(__dirname, "src/utils"),
  20. },
  21. },
  22. }
  23. })