vite.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { defineConfig } from 'vite';
  2. import vue from '@vitejs/plugin-vue';
  3. import Markdown from 'vite-plugin-md';
  4. import path from 'path';
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. resolve: {
  8. alias: [{ find: '@', replacement: path.resolve(__dirname, './src') }]
  9. },
  10. css: {
  11. preprocessorOptions: {
  12. scss: {
  13. // example : additionalData: `@import "./src/design/styles/variables";`
  14. // dont need include file extend .scss
  15. additionalData: `@import "@/styles/variables.scss";@import "@/sites/assets/styles/variables.scss";`
  16. }
  17. }
  18. },
  19. plugins: [
  20. vue({
  21. include: [/\.vue$/, /\.md$/]
  22. }),
  23. Markdown()
  24. ],
  25. build: {
  26. rollupOptions: {
  27. // make sure to externalize deps that shouldn't be bundled
  28. // into your library
  29. // external: ['vue'],
  30. // output: {
  31. // // Provide global variables to use in the UMD build
  32. // // for externalized deps
  33. // globals: {
  34. // vue: 'Vue'
  35. // }
  36. // }
  37. },
  38. lib: {
  39. entry: 'src/nutui.ts',
  40. name: 'nutui'
  41. }
  42. }
  43. });