Skip to content

打包后微信小程序dist缺少images静态图片 #18055

@xlhl-yan

Description

@xlhl-yan

请先确认

  • 我已搜索并确定这个提交不是重复的

Taro 版本

v4

相关平台

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 头条小程序
  • QQ 小程序
  • 钉钉小程序
  • 飞书小程序
  • 快手小程序

小程序基础库版本

3.8.11

使用框架

React

问题描述

taro开发微信小程序时,使用taroui模板。dev:weapp 命令,没有将images文件夹一起打包进dist

创建模板如下:

Image
项目结构如下:

Image
微信小程序结构如下:

Image
将images文件夹手动拖入无效,效果如下:

Image

第一次发 Issues,如果有不对的地方请见谅。感激不尽

复现链接

https://gitee.com/xlhl-yz/taro4-react18-boot

复现步骤

  1. pnpm i
  2. package.json -> dev:weapp
  3. 使用微信开发者工具打开dist

环境信息

👽 Taro v4.1.2


  Taro CLI 4.1.2 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.18.0 - C:\App\NVM\node\node.EXE
      Yarn: 1.22.22 - C:\App\NVM\node\yarn.CMD
      npm: 10.8.2 - C:\App\NVM\node\npm.CMD
    npmPackages:
      @tarojs/cli: 4.1.2 => 4.1.2
      @tarojs/components: 4.1.2 => 4.1.2
      @tarojs/helper: 4.1.2 => 4.1.2
      @tarojs/plugin-framework-react: 4.1.2 => 4.1.2
      @tarojs/plugin-http: ^4.1.2 => 4.1.2
      @tarojs/plugin-platform-alipay: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-h5: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-harmony-hybrid: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-jd: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-qq: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-swan: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-tt: 4.1.2 => 4.1.2
      @tarojs/plugin-platform-weapp: 4.1.2 => 4.1.2
      @tarojs/react: 4.1.2 => 4.1.2
      @tarojs/runtime: 4.1.2 => 4.1.2
      @tarojs/shared: 4.1.2 => 4.1.2
      @tarojs/taro: 4.1.2 => 4.1.2
      @tarojs/taro-loader: 4.1.2 => 4.1.2
      @tarojs/webpack5-runner: 4.1.2 => 4.1.2
      babel-preset-taro: 4.1.2 => 4.1.2
      eslint-config-taro: 4.1.2 => 4.1.2
      react: ^18.0.0 => 18.3.1
      taro-ui: ^3.3.0 => 3.3.0

贡献代码

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-reactFramework - ReactT-weappTarget - 编译到微信小程序V-4Version - 4.xbugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions