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

Support non native ES module build in production via System.js #554

Closed
hronro opened this issue Jul 15, 2020 · 2 comments
Closed

Support non native ES module build in production via System.js #554

hronro opened this issue Jul 15, 2020 · 2 comments
Labels

Comments

@hronro
Copy link
Contributor

hronro commented Jul 15, 2020

Is your feature request related to a problem? Please describe.
Currently, vite requires native ES module support in browsers for both development and production build(dynamic imports polyfill also requires native ES module support). I know vite is for modern browsers, but it would be a great help if we provide an option to allow vite to build for production without requiring native ES module support by using System.js. In the meantime, vite still requires native ES support in the development, so we won't lose any development experience.

Describe the solution you'd like
There should be something like {disableEsModule?: boolean} in vite config, and when disableEsModule is true, we can simply change the target of rollup from es to system, and insert the System.js runtime before other javascript tags in the HTML. I guess it would be easy to implement and won't break any other functionalities of vite.

@akauppi
Copy link
Contributor

akauppi commented Oct 16, 2020

It seems, currently, many are using custom Rollup builds for production (including me), while benefiting from Vite in development.

Let me know if you want help on that. I am not sure whether Vite wants to be a generic bundler (not for me to judge). Maybe the abilities to inject custom Rollup options can be used to make this happen.

@yyx990803
Copy link
Member

This is solved in 2.0. https://vitejs.dev/guide/build.html#browser-compatibility

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants