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

3.0.0 打包后 build 后,app.js 未压缩体积有 1.59m #6953

Closed
digiaries opened this issue Jul 7, 2020 · 1 comment
Closed

3.0.0 打包后 build 后,app.js 未压缩体积有 1.59m #6953

digiaries opened this issue Jul 7, 2020 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@digiaries
Copy link
Contributor

相关平台

微信小程序

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

复现步骤

  1. 启用 webpack-bundle-analyzer
  2. 执行 npm run build:weapp
  3. 查看 webpack-bundle-analyzer 的分析结果

期望结果

app.js 体积正常,不要有大量重复的库

实际结果

  1. 从输出的结果上可以看到 app.js 未压缩体积有 1.59m
  2. app.js 里有大量重复的 bn.js,readable-stream
    image

环境信息

👽 Taro v3.0.0-rc.6


  Taro CLI 3.0.0-rc.6 environment info:
    System:
      OS: macOS 10.15.5
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
      npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
    npmPackages:
      @tarojs/cli: 3.0.0 => 3.0.0
      @tarojs/components: 3.0.0 => 3.0.0
      @tarojs/mini-runner: 3.0.0 => 3.0.0
      @tarojs/react: 3.0.0 => 3.0.0
      @tarojs/runtime: 3.0.0 => 3.0.0
      @tarojs/taro: 3.0.0 => 3.0.0
      @tarojs/webpack-runner: 3.0.0 => 3.0.0
      babel-preset-taro: 3.0.0 => 3.0.0
      eslint-config-taro: 3.0.0 => 3.0.0
      react: 16.13.1 => 16.13.1
      taro-ui: 3.0.0-alpha.3 => 3.0.0-alpha.3
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jul 7, 2020
@shinken008
Copy link
Collaborator

是的,app.js不应该编译框架代码进去,应该编译到vendor里面,保证app.js的独立性,为分包和插件开发提供便利

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants