-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
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
子应用的图片资源加载不出来 #36
Comments
src 需要走 hostname + port 的绝对地址,需要改动一下 publicPath 这是由于你的 CRA 项目启在 xxx1 端口下,而 master 项目启在 xxx2 端口,在 master 里通过相对路径加载资源会导致端口号错误的问题 |
楼上正解,开发阶段需要配置一下 publicPath: hostname + port |
@kuitos 子应用用的一个,并且设置了__webpack_public_path__ = window.INJECTED_PUBLIC_PATH_BY_QIANKUN。用简单的webpack+react搭建的主应用没问题,umi搭建的主应用有子应用图片加载不出来。状态码200,preview是空的 |
@kuitos 请问,子应用已经设置了__webpack_public_path__ = window.INJECTED_PUBLIC_PATH_BY_QIANKUN;而且在webpack中配置了publicPath,但是主应用加载的子应用依然不能正确显示cdn图片路径,如下图,请问你什么思考方向吗? |
@keunone请问问题解决了吗,我也遇到了相同的问题 |
接入一个最简单的create-react-app起手模板,如下图:
The text was updated successfully, but these errors were encountered: