Skip to content

"force" a file to be splitted into multiple chunks? #2869

@richarddd

Description

@richarddd

Hey all,

I have a file from a dependency which contains a lot of exports:

export const a...
export const b...
export const c...
export const d...
....
export const ...

This file is then being used from multiple places:
file-a.js

import {a,d} from "../big-vendor-js-file.js"

file-b.js

import {b,c} from "../big-vendor-js-file.js"

When using bundling with code splitting, this file is pretty much intact but extracted to a one large chunk.

Is there anyway to "force" esbuild to chop this file into smaller prices? Right now even though just a small fraction of this file is need every module reads all the contents because of that large chunk?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions