-
+
diff --git a/vite.config.js b/vite.config.js
index 2d1a503..fb05293 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -54,6 +54,26 @@ export default defineConfig(({ mode, command }) => {
}
]
}
+ },
+ optimizeDeps: {
+ // 开发时 解决这些commonjs包转成esm包
+ include: [
+ "@jiaminghi/c-render",
+ "@jiaminghi/c-render/lib/plugin/util",
+ "@jiaminghi/charts/lib/util/index",
+ "@jiaminghi/charts/lib/util",
+ "@jiaminghi/charts/lib/extend/index",
+ "@jiaminghi/charts",
+ "@jiaminghi/color",
+ ],
+ },
+ build: {
+ // 打包时需要另外处理的commonjs规范的包
+ commonjsOptions: {
+ include: [
+ /node_modules/, // 必须包含
+ ],
+ },
}
}
})