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

perf: build optimizations #1936

Merged
merged 3 commits into from
Oct 24, 2022
Merged

perf: build optimizations #1936

merged 3 commits into from
Oct 24, 2022

Conversation

miracles1919
Copy link
Collaborator

@miracles1919 miracles1919 commented Oct 24, 2022

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#1898

💡 Background and solution

  • build es 的时候不需要 presets
  • tsconfig importHelpers: true,减少重复的 ts 辅助函数
  • build cjs 的时候增加 plugin: @babel/plugin-transform-runtime,减少重复的 babel 辅助函数

看下效果

  • es

image

优化后
image

  • cjs

image

优化后
image

可以看到:

  • var __rest = xxx 变成了 import tslib
  • var __importDefault = xxx 变成了 require ('@babel/runtime/helpers/xxx')

📝 Changelog

Language Changelog
🇺🇸 English perf: build optimizations
🇨🇳 Chinese 构建产物优化

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2022

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

3 participants