Skip to content

Bug: @lexical/code-shiki includes every Shiki import causing avoidable bundle size inflation #8515

@Soxasora

Description

@Soxasora

Due to the build/publish single-file output rule, @lexical/code-shiki includes every Shiki import and causes the bundle to grow by 8-9 megabytes.

Lexical version: v0.44.0

Steps To Reproduce

  1. Install @lexical/code-shiki
  2. import @lexical/code-shiki somewhere

The current behavior

Shiki is wholly bundled in the main bundle (or Lexical's chunk if Lexical is lazy-loaded)

image

The expected behavior

Shiki is not bundled with the app;
CodeNode should source its code language and theme from Shiki on-demand (default Shiki behavior)

Impact of fix

Apps that use @lexical/code-shiki would be 8-9 megabytes lighter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions