Skip to content
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

在Vite模式下optimizeMainPackage不生效,无法针对node_modules的模块进行分包 #17116

Open
TwitterIsGood opened this issue Dec 29, 2024 · 0 comments

Comments

@TwitterIsGood
Copy link

相关平台

微信小程序

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

复现步骤

使用Taro Cli4.0.8新建项目,使用Vite作为编译器,安装moment包,配置optimizeMainPackage后打包后vendor依然很大,且未能打入分包

期望结果

将moment打入分包

实际结果

moment未能打入分包

环境信息

npx taro info
👽 Taro v4.0.8


  Taro CLI 4.0.8 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.11.1 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.22.21 - D:\Program Files\nodejs\node_global\yarn.CMD
      npm: 10.4.0 - D:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.8 => 4.0.8
      @tarojs/components: 4.0.8 => 4.0.8
      @tarojs/helper: 4.0.8 => 4.0.8
      @tarojs/plugin-framework-react: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-alipay: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-h5: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-harmony-hybrid: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-jd: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-qq: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-swan: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-tt: 4.0.8 => 4.0.8
      @tarojs/plugin-platform-weapp: 4.0.8 => 4.0.8
      @tarojs/react: 4.0.8 => 4.0.8
      @tarojs/runtime: 4.0.8 => 4.0.8
      @tarojs/shared: 4.0.8 => 4.0.8
      @tarojs/taro: 4.0.8 => 4.0.8
      @tarojs/vite-runner: 4.0.8 => 4.0.8
      babel-preset-taro: 4.0.8 => 4.0.8
      eslint-config-taro: 4.0.8 => 4.0.8
      react: ^18.0.0 => 18.3.1
This was referenced Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant