We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`"qiankun": "^2.10.16",
主应用为vite+vue3 地址为http://localhost:8000,子应用为cra构建的react18,地址为http://localhost:3000 访问子应用时不能加载antd组件,删除antd组件也不能正确加载样式(只有基本的html),并且图片资源的请求地址是http://localhost:8000/xxx(两个项目有相同名字的图片) 子应用已经在indexjs入口文件设置了__webpack_public_path__和路由basename 子应用config-overrides.js重写的相关配置如下 config => { // 设置输出为 UMD 格式,以便 Qiankun 能够正确加载生命周期函数 config.output.library = 'reactApp' // 子应用的名称,与你在主应用中注册的名称一致 config.output.libraryTarget = 'umd' config.output.chunkLoadingGlobal = webpackJsonp_reactApp // 避免与主应用的 Webpack JSONP 函数冲突
webpackJsonp_reactApp
// 配置 Polyfill config.resolve.fallback = { ...config.resolve.fallback, fs: false, path: require.resolve('path-browserify'), crypto: require.resolve('crypto-browserify'), stream: require.resolve('stream-browserify'), buffer: require.resolve('buffer/') // 根据需要添加更多模块 } // 提供全局变量 config.plugins.push( new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }) ) // 修改 devServer 配置以支持 CORS if (config.devServer) { config.devServer.headers = { 'Access-Control-Allow-Origin': '*' } config.devServer.historyApiFallback = true // 支持前端路由 } return config }
The text was updated successfully, but these errors were encountered:
由于缺乏足够的信息(github、stackblitz、codesandbox等可复现仓库),我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。如果只是单独的技术咨询,可移步 https://qiankun.umijs.org/#-community 交流~
Sorry, something went wrong.
No branches or pull requests
`"qiankun": "^2.10.16",
主应用为vite+vue3 地址为http://localhost:8000,子应用为cra构建的react18,地址为http://localhost:3000
访问子应用时不能加载antd组件,删除antd组件也不能正确加载样式(只有基本的html),并且图片资源的请求地址是http://localhost:8000/xxx(两个项目有相同名字的图片)
子应用已经在indexjs入口文件设置了__webpack_public_path__和路由basename
子应用config-overrides.js重写的相关配置如下
config => {
// 设置输出为 UMD 格式,以便 Qiankun 能够正确加载生命周期函数
config.output.library = 'reactApp' // 子应用的名称,与你在主应用中注册的名称一致
config.output.libraryTarget = 'umd'
config.output.chunkLoadingGlobal =
webpackJsonp_reactApp
// 避免与主应用的 Webpack JSONP 函数冲突The text was updated successfully, but these errors were encountered: