If you set root https://vitejs.dev/config/#root Maybe don't pass viteConfig.root will fix it... vite-plugin-imp/src/index.ts Line 63 in 45602cb code: addImportToCode(code, config, viteConfig.command, viteConfig.root, config.ignoreStylePa...
萧易于 长江黄河都是水vite+react+antd,antd样式使用 vite-plugin-imp按需引入,默认的写法会造成组件动画、点击事件丢失等问题,使用以下方式纠正:vitePluginImp({ libList: [ { libName: 'antd', style: (name) => `antd/es/${name}/style` } ]}) 发布于 2021-12-20 12:30 赞同 分享收藏 ...
// vite.config.jsimport{defineConfig}from'vite'importvuefrom'@vitejs/plugin-vue'importvitePluginImpfrom'vite-plugin-imp'exportdefaultdefineConfig({plugins:[// ...vitePluginImp({libList:[{libName:'lodash',libDirectory:'',camel2DashComponentName:false},{libName:'antd',style(name){// use lessre...
import { Button, Row, Col, Card, Form, Space, Input,message } from 'antd' import { FormRender } from '@/components' import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons' import './App.css' console.log(111); //代码里面是第6行 到了浏览器就是变成14行。发现如果没有...
// vite.config.jsimport{ defineConfig }from'vite'importvuefrom'@vitejs/plugin-vue'importvitePluginImpfrom'vite-plugin-imp'exportdefaultdefineConfig({plugins: [// ...vitePluginImp({libList: [ {libName:'lodash',libDirectory:'',camel2DashComponentName:false}, {libName:'antd', style(name) {/...