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
In a couple of projects using vite, I had issues related to the build: the project would work as expected with vite development server, but wouldn't work after a build.
I'm not a vite expert and the steps used to transform the source code into the "final", running code are not very clear to me: minification, bundling, tree-shaking and generation of source maps are some of them, but there are likely many more - or they are more complex than I can figure. Issues are probably in my code, or 3rd party's, and in how they interact with all these transformations. Or maybe there's a bug in a tool somewhere, albeit unlikely.
Indeed, it's hard to track where the issue might be, especially if there is behind-the-scene caching or partial builds or similar things involved.
So, I was wondering if there is a way to build a project with vite that transforms the code as little as possible. I don't care about optimizations, about bundling or serving efficiency: ideally, the code is transformed as little as possible to be served as static content.
How can I achieve something like this? Something like producing precisely the code that the dev server is outputting, minus HMR, file watchers and similar niceties for development.
I'm using vite 5 in these projects, but I would consider migrating to 6 if not too painful and needed to answer this questionn.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In a couple of projects using vite, I had issues related to the build: the project would work as expected with vite development server, but wouldn't work after a build.
I'm not a vite expert and the steps used to transform the source code into the "final", running code are not very clear to me: minification, bundling, tree-shaking and generation of source maps are some of them, but there are likely many more - or they are more complex than I can figure. Issues are probably in my code, or 3rd party's, and in how they interact with all these transformations. Or maybe there's a bug in a tool somewhere, albeit unlikely.
Indeed, it's hard to track where the issue might be, especially if there is behind-the-scene caching or partial builds or similar things involved.
So, I was wondering if there is a way to build a project with vite that transforms the code as little as possible. I don't care about optimizations, about bundling or serving efficiency: ideally, the code is transformed as little as possible to be served as static content.
How can I achieve something like this? Something like producing precisely the code that the dev server is outputting, minus HMR, file watchers and similar niceties for development.
I'm using vite 5 in these projects, but I would consider migrating to 6 if not too painful and needed to answer this questionn.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions