-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
37 lines (35 loc) · 964 Bytes
/
vite.config.ts
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
28
29
30
31
32
33
34
35
36
37
import { defineConfig, loadEnv } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import AutoImport from "unplugin-auto-import/vite";
// import VComponents from 'unplugin-vue-components/vite'
import Components from "@uni-helper/vite-plugin-uni-components";
import { NutResolver } from "nutui-uniapp";
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd());
return {
define: {
"process.env": env
},
css: {
postcss: {
plugins: [require("tailwindcss"), require("autoprefixer")]
},
preprocessorOptions: {
scss: {
additionalData: '@import "nutui-uniapp/styles/variables.scss";'
}
}
},
plugins: [
Components({
resolvers: [NutResolver()]
}),
uni(),
// UnoCSS(),
AutoImport({
imports: ["vue", "uni-app", "pinia"],
dirs: ["src/**/index.ts", "src/api/*.ts"]
})
]
};
});