-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
feat(build): integrate tree-shaker for improved bundle optimization #4994
base: master
Are you sure you want to change the base?
Conversation
vue-component-meta
vue-component-type-helpers
@vue/language-plugin-pug
@vue/language-core
@vue/language-server
@vue/language-service
vue-tsc
@vue/typescript-plugin
commit: |
ae194a1
to
940b97c
Compare
@KermanX I think this PR is almost successful, but tree-shaker seems to have some template string/regex conversion problems, can you take a look? |
Yes, I've noticed that bug, but I can't immediately solve it because I need to investigate how to escape the template literal in oxc 🥲. |
…into tree-shaker
I've used a workaround to solve the template literal escaping issue. Currently, this PR is tree-shaking thousands of input files, which may lose many import chances compared to tree-shaking the bundled js. I found that the |
Unfortunately the output file is currently corrupt and still needs to be investigated. #4998 changes the project dependencies too much, so it's relatively difficult to merge (and I haven't finished reviewing all the changes yet), and if we can successfully merge this PR first, and move on to #4998 in the future, I think there is no harm. |
I've fixed another bug. And I can't find more problems myself now. |
bf71d7c
to
c9a2174
Compare
c3e80dc
to
209717c
Compare
I just found that the filter used to be Sadly, after this fix, tree-shaker can only make the bundle size less than 0.01 MB smaller. This is quite expected because tree-shaker aims to remove unused code, but individual source modules always don't have useless code themselves. I will work on making tree-shaking the bundled code work. |
Tree shaking power by https://github.com/KermanX/tree-shaker.