1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- // import { createStyleImportPlugin } from "vite-plugin-style-import";
- import vueJsx from "@vitejs/plugin-vue-jsx";
- import legacy from "@vitejs/plugin-legacy";
- import AutoImport from "unplugin-auto-import/vite";
- import Components from "unplugin-vue-components/vite";
- import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
- import path from "path";
- function resolve(dir: string) {
- return path.join(__dirname, dir);
- }
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- vueJsx(),
- legacy({
- targets: ["> 0.25%, not dead"],
- ignoreBrowserslistConfig: true,
- }),
- AutoImport({
- resolvers: [NaiveUiResolver()],
- }),
- Components({
- resolvers: [NaiveUiResolver()],
- }),
- // createStyleImportPlugin({
- // libs: [
- // {
- // libraryName: "@arco-design/web-vue",
- // esModule: true,
- // resolveStyle: (name) => {
- // // css
- // return `@arco-design/web-vue/es/${name}/style/css.js`;
- // // less
- // return `@arco-design/web-vue/es/${name}/style/index.js`;
- // },
- // },
- // ],
- // }),
- ],
- resolve: {
- alias: {
- "@": resolve("./src"),
- "@components": resolve("./src/components"),
- },
- },
- server: {
- host: "0.0.0.0",
- port: 3000,
- strictPort: true,
- cors: true,
- open: true,
- },
- });
|