import react from '@vitejs/plugin-react-swc'; import UnoCSS from 'unocss/vite'; import { defineConfig, PluginOption } from 'vite'; import pluginImport from 'vite-plugin-importer'; import svgr from 'vite-plugin-svgr'; import tsconfigPaths from 'vite-tsconfig-paths'; /// // https://vite.dev/config/ export default defineConfig({ resolve: { alias: [], }, plugins: [ svgr() as PluginOption, react(), UnoCSS(), pluginImport({ libraryName: '@nutui/nutui-react', libraryDirectory: 'dist/esm', style: (path: string) => `${path}/style/css`, }), tsconfigPaths() as PluginOption, ], css: { modules: { hashPrefix: 'prefix', generateScopedName: '[name]__[local]__[hash:base64:5]', }, preprocessorOptions: { sass: { api: 'modern', additionalData: `@nutui/nutui-react/dist/styles/variables.scss`, }, }, }, });