Skip to content

fix: proxy virtual import globs through fs modules#2610

Merged
antfu merged 3 commits into
slidevjs:mainfrom
kermanx:xtr/import-glob-proxy-context
Jun 3, 2026
Merged

fix: proxy virtual import globs through fs modules#2610
antfu merged 3 commits into
slidevjs:mainfrom
kermanx:xtr/import-glob-proxy-context

Conversation

@kermanx

@kermanx kermanx commented Jun 1, 2026

Copy link
Copy Markdown
Member

fixes #2605

Summary

  • Proxy virtual module import.meta.glob calls through generated filesystem modules so Vite resolves globs from a real importer.
  • Bind the proxy helper to userRoot once and expose a narrower makeAbsoluteImportGlob(globs, options?) context API.
  • Type virtual module context against Vite/Rolldown plugin context to avoid Rollup/Rolldown resolve type mismatches.

Tests

  • pnpm exec eslint packages/slidev/node/utils.ts packages/slidev/node/virtual/conditional-styles.ts packages/slidev/node/virtual/global-layers.ts packages/slidev/node/virtual/setups.ts packages/slidev/node/vite/loaders.ts test/utils.test.ts test/mermaid-renderer.test.ts
  • pnpm exec vitest run test/utils.test.ts test/mermaid-renderer.test.ts

Note: pnpm typecheck still fails on existing docs/node_modules/vitepress/... TS7016 declaration errors unrelated to this change.

@netlify

netlify Bot commented Jun 1, 2026

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit 8359b5d
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6a1d3086936ff900093b343e
😎 Deploy Preview https://deploy-preview-2610--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.

@pkg-pr-new

pkg-pr-new Bot commented Jun 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

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

create-slidev

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

create-slidev-theme

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

@slidev/parser

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

@slidev/cli

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

@slidev/types

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

commit: 8359b5d

@kermanx
kermanx force-pushed the xtr/import-glob-proxy-context branch from 60b07cf to cdf46b8 Compare June 1, 2026 06:51
@kermanx
kermanx force-pushed the xtr/import-glob-proxy-context branch from cdf46b8 to 831054b Compare June 1, 2026 06:54
@antfu
antfu merged commit aff984c into slidevjs:main Jun 3, 2026
20 checks passed
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.

@slidev/conditional-styles emits unresolvable Windows-path imports on pnpm (regression from #2573)

2 participants