48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import {fileURLToPath, URL} from "node:url";
|
|
|
|
import {defineConfig} from "vite";
|
|
import Components from "@uni-helper/vite-plugin-uni-components";
|
|
import {WotResolver, uViewProResolver} from "@uni-helper/vite-plugin-uni-components/resolvers";
|
|
import {NutResolver} from "nutui-uniapp";
|
|
import Uni from "@uni-helper/plugin-uni";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url))
|
|
}
|
|
},
|
|
plugins: [
|
|
// https://uni-helper.js.org/vite-plugin-uni-components
|
|
Components({
|
|
dts: true,
|
|
resolvers: [WotResolver(), NutResolver(), uViewProResolver()]
|
|
}),
|
|
// https://uni-helper.js.org/plugin-uni
|
|
Uni(),
|
|
AutoImport({
|
|
imports: [
|
|
"vue",
|
|
{
|
|
radashi: [["*", "dash"]],
|
|
"@vueuse/shared": [["*", "deep"]],
|
|
"@uni-helper/uni-use": [["*", "vueuse"]]
|
|
}
|
|
],
|
|
dts: "./auto-imports.d.ts",
|
|
})
|
|
],
|
|
build: {
|
|
target: "es6",
|
|
cssTarget: "chrome61"
|
|
},
|
|
optimizeDeps: {
|
|
exclude: [
|
|
"vue-demi"
|
|
]
|
|
},
|
|
});
|
|
|
|
|