vite.config.js 630 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig } from "vite";
  2. import uni from "@dcloudio/vite-plugin-uni";
  3. import path from 'path'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. plugins: [
  7. uni(),
  8. ],
  9. resolve: {
  10. alias: {
  11. 'uview-plus': path.resolve(__dirname, './uni_modules/uview-plus')
  12. }
  13. },
  14. css: {
  15. preprocessorOptions: {
  16. scss: {
  17. // 取消sass废弃API的报警
  18. silenceDeprecations: ['legacy-js-api', 'color-functions', 'import'],
  19. },
  20. },
  21. },
  22. server: {
  23. port: 5100,
  24. fs: {
  25. // Allow serving files from one level up to the project root
  26. allow: ['..']
  27. }
  28. },
  29. });