37 lines
937 B
TypeScript
37 lines
937 B
TypeScript
import { defineConfig } from "vite";
|
|
import uni from "@dcloudio/vite-plugin-uni";
|
|
import { resolve } from 'path';
|
|
|
|
import Components from "@uni-helper/vite-plugin-uni-components";
|
|
import { WotResolver } from "@uni-helper/vite-plugin-uni-components/resolvers";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(async () => {
|
|
const UnoCSS = await import("unocss/vite").then((i) => i.default);
|
|
|
|
return {
|
|
plugins: [
|
|
Components({
|
|
resolvers: [WotResolver()],
|
|
include: [/\.vue$/],
|
|
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
|
}),
|
|
uni(),
|
|
// https://github.com/unocss/unocss
|
|
UnoCSS(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
}
|
|
},
|
|
build: {
|
|
target: 'es2015',
|
|
cssTarget: 'chrome61',
|
|
commonjsOptions: {
|
|
include: [/wot-design-uni/, /node_modules/],
|
|
}
|
|
}
|
|
};
|
|
});
|