Skip to content

Entire Assets Folder Shown in Chrome Dev Tools/ All Svelte components and Svelte source code available in Dev Tools #57

Answered by woutdp
Mali-2 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Mali-2 thanks for the interest :)

At the moment all Svelte files are included inside the singular js bundle that's being generated. By default, Phoenix with Esbuild doesn't do code splitting. It just includes one big js bundle. Sveltekit does use code splitting which is what you're referring to I believe. The entrypoint for the bundle in Phoenix is the app.js file and you'll notice the line:

import * as SvelteComponents from "../svelte/**/*"

This dynamically includes all Svelte files in the svelte/ directory.

I'm not sure how hard it is to add code splitting to a phoenix project with Esbuild. From the documentation it seems esbuild doesn't really support it fully. An alternative would…

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
9 replies
@woutdp
Comment options

@cvkmohan
Comment options

@woutdp
Comment options

@cvkmohan
Comment options

@christophertrudel
Comment options

Answer selected by Mali-2
Comment options

You must be logged in to vote
2 replies
@zhangzhen
Comment options

@sarat1669
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants