-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (26 loc) · 858 Bytes
/
vite.config.ts
File metadata and controls
27 lines (26 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import uni from '@dcloudio/vite-plugin-uni';
import { defineConfig, type Plugin, type UserConfigExport } from 'vite';
// https://vitejs.dev/config/
export default async (): Promise<UserConfigExport> => {
const UnoCSS = (await import("unocss/vite")).default;
const json5 = (await import('vite-plugin-json5')).default;
return defineConfig({
plugins: [
uni(),
json5(),
UnoCSS()
],
css: {
preprocessorOptions: {
scss: {
additionalData: (source: string, filePath: string) => {
if (filePath.includes('/src/components/') || filePath.includes('/src/pages/')) {
return `@use "@partner-up-dev/design-uniapp/styles/mixins" as *;@use "@partner-up-dev/design-uniapp/styles/functions" as *;\n${source}`
}
return source
}
}
}
}
})
}