From c86c498ab9711871aaf2dc08a022309f7f9297ef Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 19 Dec 2024 21:06:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=AF=91cjs=E5=92=8Ccss?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=AF=BC=E8=87=B4=E5=88=87=E6=8D=A2=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=89=B2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index d8539cb5..5651be11 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -41,18 +41,6 @@ export default defineConfig(({ mode }) => { }, extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], }, - css: { - preprocessorOptions: { - less: { - // DO NOT REMOVE THIS LINE - javascriptEnabled: true, - modifyVars: { - // hack: `true; @import 'ant-design-vue/dist/antd.variable.less'`, - // '@primary-color': '#eb2f96', // 全局主色 - }, - }, - }, - }, build: { target: 'esnext', // Use 'esnext' to support the latest features sourcemap: false, @@ -68,12 +56,7 @@ export default defineConfig(({ mode }) => { assetFileNames: 'assets/[name].[hash].[ext]', manualChunks: { vendorVue: ['vue', 'vue-router', 'pinia'], - vendorVuePlugins: [ - 'vue-i18n', - 'vue3-smooth-dnd', - 'grid-layout-plus', - '@vueuse/core', - ], + vendorVuePlugins: ['vue-i18n', 'vue3-smooth-dnd', 'grid-layout-plus', '@vueuse/core'], vendorAnt: ['ant-design-vue', '@ant-design/icons-vue'], vendorAntv: ['@antv/g6'], vendorEcharts: ['echarts'], @@ -111,7 +94,7 @@ export default defineConfig(({ mode }) => { AntDesignVueResolver({ importStyle: false, resolveIcons: true, - cjs: true, // 避免es模块打包缺失 + cjs: false, // 统一使用es模块打包 }), ], }),