Skip to content

Emit separate chunks for each component #244

Open
@Bilge

Description

@Bilge

How can I configure webpack to emit separate chunks for each Svelte 5 component? It seems Vite accomplishes this with very little persuasion, but in my multi-page application, all I have is one output for each entrypoint and I cannot convince webpack to split out the components, even with a custom splitChunks plugin configuration, such as the following.

cacheGroups: {
    svelte: {
        test(module) {
            return module.resource && module.resource.endsWith('.svelte');
        },
    },
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions