NervJS/taro

使用 yalc 添加到项目的依赖,热更新时小程序没有获取到最新的变更

AimLuo opened this issue · 1 comments

相关平台

微信小程序

小程序基础库: 3.4.3
使用框架: React

复现步骤

  1. @skyreading/design 项目 yalc publish 之后,
  2. 使用 yalc add 到B项目。
  3. 修改 A项目之后,重新 yalc push,(在A项目的node_modules 中能看到变更之后的文件)
  4. 此时 B项目热更新,没有获取到最新的变更,必须重新 yarn dev:weapp

config/dev.ts 配置如下:

module.exports = {
  env: {
    NODE_ENV: '"development"'
  },
  defineConstants: {
  },
  mini: {
    compiler: {
      type: 'webpack5',
      prebundle: {
        exclude: ['@skyreading/design']
      }
    }
  },
  h5: {},
  // compiler.prebundle.exclude
  compiler: {
    type: 'webpack5',
    prebundle: {
      exclude: ['@skyreading/design']
    }
  }
}

期望结果

热更新时,yalc添加的依赖项变更生效

实际结果

热更新时,yalc添加的依赖项变更未生效

环境信息

  Taro CLI 3.6.29 environment info:
    System:
      OS: macOS 14.4.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.20.2 - ~/Library/Caches/fnm_multishells/13702_1715600378782/bin/node
      Yarn: 1.22.22 - ~/Library/Caches/fnm_multishells/13702_1715600378782/bin/yarn
      npm: 10.5.0 - ~/Library/Caches/fnm_multishells/13702_1715600378782/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.29 => 3.6.29 
      @tarojs/components: 3.6.29 => 3.6.29 
      @tarojs/helper: 3.6.29 => 3.6.29 
      @tarojs/plugin-framework-react: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-alipay: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-h5: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-jd: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-qq: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-swan: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-tt: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-weapp: 3.6.29 => 3.6.29 
      @tarojs/react: 3.6.29 => 3.6.29 
      @tarojs/rn-runner: 3.6.29 => 3.6.29 
      @tarojs/rn-supporter: 3.6.29 => 3.6.29 
      @tarojs/runtime: 3.6.29 => 3.6.29 
      @tarojs/runtime-rn: 3.6.29 => 3.6.29 
      @tarojs/shared: 3.6.29 => 3.6.29 
      @tarojs/taro: 3.6.29 => 3.6.29 
      @tarojs/taro-loader: 3.6.29 => 3.6.29 
      @tarojs/taro-rn: 3.6.29 => 3.6.29 
      @tarojs/webpack5-runner: 3.6.29 => 3.6.29 
      babel-preset-taro: 3.6.29 => 3.6.29 
      eslint-config-taro: 3.6.29 => 3.6.29 
      expo: ~47.0.3 => 47.0.14 
      react: ^18.1.0 => 18.3.1 
image image 重启项目就好了