Skip to content

fix(cli): avoid circular chunk warning between monaco types and shiki#2467

Open
mjvo wants to merge 5 commits into
slidevjs:mainfrom
mjvo:manualChunks
Open

fix(cli): avoid circular chunk warning between monaco types and shiki#2467
mjvo wants to merge 5 commits into
slidevjs:mainfrom
mjvo:manualChunks

Conversation

@mjvo
Copy link
Copy Markdown
Contributor

@mjvo mjvo commented Feb 27, 2026

This removes hard manual chunk assignment for Monaco types and Shiki in
packages/slidev/node/vite/extendConfig.ts.

Why:

  • current manual assignments can produce:
    Circular chunk: monaco/bundled-types -> modules/shiki -> monaco/bundled-types

What changed:

  • for Monaco types and Shiki ids, manualChunks now returns undefined
    (let Rollup decide chunk placement)
  • existing icon and async module chunk rules remain unchanged

Validation:

  • reproduced warning before change
  • warning no longer appears after change
  • local lint passes

before: circular chunk warning appears
after: warning no longer appears

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit bd8fa9e
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/69fc318b05388300087f2538
😎 Deploy Preview https://deploy-preview-2467--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kermanx kermanx requested a review from antfu March 19, 2026 07:05
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 19, 2026

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/@slidev/client@2467

create-slidev

npm i https://pkg.pr.new/create-slidev@2467

create-slidev-theme

npm i https://pkg.pr.new/create-slidev-theme@2467

@slidev/parser

npm i https://pkg.pr.new/@slidev/parser@2467

@slidev/cli

npm i https://pkg.pr.new/@slidev/cli@2467

@slidev/types

npm i https://pkg.pr.new/@slidev/types@2467

commit: bd8fa9e

@antfu
Copy link
Copy Markdown
Member

antfu commented May 7, 2026

I think the reason we use manual chunking is that we want to pack the related code into a single chunk for better output structure and client load efficiency. In terms of the circular references, I think we should figure out why and where the shared chunk is to perform better manual chunking.

Removing it basically loses the original point of doing manual chunking, as both Monaco and Shiki generate too many chunks, which is suboptimal.

Other than improving the manual chunking, I think we may also add an option to disable manual chunking logic entirely if people prefer automatic chunking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants