vite.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import {
  2. defineConfig,
  3. } from 'vite';
  4. import vue from '@vitejs/plugin-vue';
  5. import ViteComponents from 'vite-plugin-components';
  6. import path from 'path';
  7. // https://vitejs.dev/config/
  8. export default defineConfig({
  9. base: '/gongdian-map/',
  10. resolve: {
  11. alias: {
  12. '@': path.resolve(__dirname, 'src'),
  13. },
  14. },
  15. plugins: [
  16. vue(),
  17. ViteComponents({
  18. libraryName: 'ant-design-vue',
  19. libraryDirectory: 'es',
  20. style: 'less',
  21. }),
  22. ],
  23. css: {
  24. preprocessorOptions: {
  25. less: {
  26. // 支持内联 JavaScript
  27. javascriptEnabled: true,
  28. // 重写 less 变量,定制样式
  29. modifyVars: {
  30. 'primary-color': '#16D8FF',//全局主色
  31. 'text-color': '#16D8FF', // 主文本色
  32. 'font-size-base': '14rem', // 基础字号大小
  33. 'tabs-title-font-size': '14rem',
  34. 'tabs-vertical-padding': '8rem 12rem',
  35. 'heading-color': 'white',
  36. 'body-background': 'rgba(11, 47, 91, 1)',//背景颜色
  37. 'component-background': 'rgba(11, 47, 91, 1)',//主要背景颜色
  38. 'item-hover-bg': 'rgba(11, 47, 91, 1)',
  39. 'item-active-bg': 'rgba(11, 47, 91, 1)',
  40. 'select-item-selected-color': '#f5ed38',
  41. 'select-item-selected-bg': '#e6ffff00',
  42. 'border-color-inverse': '#16D8FF',
  43. },
  44. },
  45. },
  46. },
  47. build: {
  48. outDir: 'gongdian-map',
  49. minify: false,
  50. sourcemap: false,
  51. },
  52. });