How can I avoid all my builded files to be named index
#9515
Unanswered
nicolas-goudry
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there 👋
I’m using vite with React 17 and use code splitting through the use of
import()
. I also use React’slazy
function to lazy-load my routes.I have a file architecture like this:
Whenever I want to import a component, I do it like this (I use the resolve.alias feature of vite):
Everything is working fine but I noticed that when I build my app, I end up with several
index-[hash].js
files in thedist/assets
directory… And I don’t really like that:I tried playing with
rollupOptions.output.chunkFileNames
but that doesn’t feel right…Is there a cleaner way to do that?
Thanks! ✌️
EDIT: I also opened up a SO question on this matter.
Beta Was this translation helpful? Give feedback.
All reactions