ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

按照配置自动引入后 打包体积还是一点多兆

Open woshishulai opened this issue 1 year ago • 0 comments
trafficstars

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.3

Environment

mac 谷歌 vue3

Reproduction link

https://gitee.com/maxhom/taiwan-lingzong

Steps to reproduce

为什么打包完 antd的体积是一点多兆 我已经配置了自动引入 import { defineConfig } from "vite"; import { resolve } from "path"; import vue from "@vitejs/plugin-vue"; import Components from "unplugin-vue-components/vite"; import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";

export default defineConfig({ plugins: [ vue(), Components({ resolvers: [ AntDesignVueResolver({ importStyle: false, // css in js }), ], }), ], css: { preprocessorOptions: { less: { additionalData: '@import "./src/assets/css/mixin.less";', javascriptEnabled: true, modifyVars: { "@primary-color": "#034078", "@link-color": "#034078", }, }, }, }, resolve: { alias: [ { find: "@", replacement: resolve(__dirname, "/src"), }, { find: "@img", replacement: resolve(__dirname, "/src/assets/img"), }, ], }, server: { port: 8080, proxy: { "/api": { target: "http://47.95.213.19:9983", changeOrigin: true, rewrite: (path) => path.replace(/^/api/, ""), }, }, }, });

What is expected?

体积不应该是一点多兆

What is actually happening?

实际上我没有用多少组件 体积不应该是这么大


请处理打包体积

woshishulai avatar Aug 31 '24 08:08 woshishulai