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
微信小程序
小程序基础库: 2.19.0 使用框架: React
在业务代码中引用,自己开发的组件,打包成微信小程序后,上传到微信小程序,生成体验版
正常显示图片,或者能提供其他解决方案也行,改变打包后,图片资源放到 node_modules 文件夹下
自定义组件包目前还没有发布到 npm 上。。
小程序转发不显示本地图片
👽 Taro v3.4.8 Taro CLI 3.4.8 environment info: System: OS: macOS 12.3.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node Yarn: 1.22.11 - ~/.nvm/versions/node/v14.16.1/bin/yarn npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm npmPackages: @tarojs/cli: 3.4.8 => 3.4.8 @tarojs/components: 3.4.8 => 3.4.8 @tarojs/mini-runner: 3.4.8 => 3.4.8 @tarojs/react: 3.4.8 => 3.4.8 @tarojs/runtime: 3.4.8 => 3.4.8 @tarojs/taro: 3.4.8 => 3.4.8 @tarojs/webpack-runner: 3.4.8 => 3.4.8 babel-preset-taro: 3.4.8 => 3.4.8 eslint-config-taro: 3.4.8 => 3.4.8 react: ^17.0.0 => 17.0.2 react-native: ^0.67.3 => 0.67.4 taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10 npmGlobalPackages: typescript: 4.2.4
自定义组件,内部部分代码 imageUrl:引用的本地图片 规格为 4kb 1:1
useShareAppMessage((res) => { console.log("path", path); return { title: title, imageUrl: thumbImangeUrl ?? require("./icon/60.png"), path, }; });
开发组件目录结构:
业务打包生成微信小程序图片目录:
The text was updated successfully, but these errors were encountered:
解决方案: 在config/index.js增加如下代码
mini: { imageUrlLoaderOption: { name: (resourcePath) => { return resourcePath.replace(path.resolve(__dirname, '..'), '').replace(/node_modules/gi, 'npm') }, }, }
Sorry, something went wrong.
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.19.0
使用框架: React
复现步骤
在业务代码中引用,自己开发的组件,打包成微信小程序后,上传到微信小程序,生成体验版
期望结果
正常显示图片,或者能提供其他解决方案也行,改变打包后,图片资源放到 node_modules 文件夹下
自定义组件包目前还没有发布到 npm 上。。
实际结果
小程序转发不显示本地图片
环境信息
补充信息
自定义组件,内部部分代码
imageUrl:引用的本地图片 规格为 4kb 1:1
开发组件目录结构:
业务打包生成微信小程序图片目录:
The text was updated successfully, but these errors were encountered: