fix: 编译cjs和css方式导致切换主题色异常
This commit is contained in:
@@ -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模块打包
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user