You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use system0.21.6 to load main.jsx instead use type:module to load, shown as below:
Then use @babel/plugin-transform-modules-amd to transform source files so that SystemJS.import can work, shown as below:
Inspect page, what main.jsx shows is:
You can see except React an React-DOM which we can inject into html manually or automatically, and use SystemJS.register to initialize them. we have another dependence, named ./App.jsx, that means if we have 5 dependencies. we need use SystemJS.register to register them one by one. that's not what I want.
So I think Vite should bundle all code of src folder into to one single file(maybe main.jsx) when serve mode.
Hope can get your responses as soon as possible.
Best regards.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Use system0.21.6 to load main.jsx instead use type:module to load, shown as below:
Then use
@babel/plugin-transform-modules-amd
to transform source files so that SystemJS.import can work, shown as below:Inspect page, what main.jsx shows is:
You can see except React an React-DOM which we can inject into html manually or automatically, and use
SystemJS.register
to initialize them. we have another dependence, named./App.jsx
, that means if we have 5 dependencies. we need useSystemJS.register
to register them one by one. that's not what I want.So I think Vite should bundle all code of
src folder
into to one single file(maybe main.jsx) when serve mode.Hope can get your responses as soon as possible.
Best regards.
Reproduction
https://stackblitz.com/edit/vitejs-vite-wzmngy?file=vite.config.js
Steps to reproduce
just open stackblitz, then inspect page, check the network.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: