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

@vitejs/plugin-legacy support only output legacy bundle #9050

Closed
4 tasks done
xiaoxiangmoe opened this issue Jul 12, 2022 · 5 comments · Fixed by #10139
Closed
4 tasks done

@vitejs/plugin-legacy support only output legacy bundle #9050

xiaoxiangmoe opened this issue Jul 12, 2022 · 5 comments · Fixed by #10139

Comments

@xiaoxiangmoe
Copy link
Contributor

xiaoxiangmoe commented Jul 12, 2022

Description

In vue-cli v5, vue-cli-service build --no-module will only output the legacy bundles that support all target browsers (loaded via plain <script>s). See Vue CLI --no-module

But @vitejs/plugin-legacy will output both modern and legacy codes.

Suggested solution

Can we add --no-module config in vite-plugin-legacy?

Alternative

No response

Additional context

No response

Validations

@github-actions
Copy link

Hello @xiaoxiangmoe. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!

@sangquangnguyen
Copy link
Contributor

sangquangnguyen commented Jul 18, 2023

Hi @xiaoxiangmoe , could you try this feature? I used
legacy({ renderModernChunks: false }) then I will get the entry point is index-legacy-123456.js in manifest.json, but when I used it, I will encounter the issue System is not defined, do you know this issue?
<script type="module" src="base_url/index-legacy-123456.js" />

@patak-dev
Copy link
Member

@sangquangnguyen would you create a new issue with a minimal reproduction linking to the issue and PR? Thanks!

@sangquangnguyen
Copy link
Contributor

sangquangnguyen commented Jul 18, 2023

@sangquangnguyen would you create a new issue with a minimal reproduction linking to the issue and PR? Thanks!

Ah, sorry for bothering you 😅 , I just want to have a quick check whether the author of this issue encountered another issue like me or this function works well on their end. I might have some wrong configs, let me do more investigations and create a ticket with the details if needed, thanks @patak-dev for your time ❤️

@sangquangnguyen
Copy link
Contributor

I found out the reason, I saw in manifest.json we have vite/legacy-polyfills-legacy file, we have to include this polyfill-legacy file into the script before the entry point to load all necessary polyfills. Thanks everyone 🚀

@github-actions github-actions bot locked and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants