vite-plugin-qiankun icon indicating copy to clipboard operation
vite-plugin-qiankun copied to clipboard

生产环境跳转子应用时报错[import-html-entry]: error occurs while executing normal script

Open lucky-zouzou opened this issue 2 years ago • 2 comments

主应用和子应用都是vite构建的vue3项目,子应用使用此依赖,在开发环境可以正常跳转,但是打包到线上环境跳转时会报以下错误:

image

lucky-zouzou avatar Oct 09 '22 03:10 lucky-zouzou

i think problem is related to the fact that qiankun not supports top level import

Relaxe111 avatar Oct 11 '22 20:10 Relaxe111

这个问题已解决,是由于线上环境找不到资源报的错,需要在子项目的config中添加配置: export const viteConfig = defineConfig(({ command, mode }) => ({ ... // 嵌套公共路径部署,路径重写 base: mode === 'development' ? './' : '对应环境的地址', ...... }));

lucky-zouzou avatar Oct 17 '22 02:10 lucky-zouzou