Skip to content

chore: reduce rollup import usage#5166

Merged
zettca merged 2 commits into
masterfrom
fix/stuff
May 12, 2026
Merged

chore: reduce rollup import usage#5166
zettca merged 2 commits into
masterfrom
fix/stuff

Conversation

@zettca
Copy link
Copy Markdown
Member

@zettca zettca commented May 12, 2026

  • reduce rollup-specific imports (just types, no impact)
  • migrate CJS __dirname to import.meta.dirname

Copilot AI review requested due to automatic review settings May 12, 2026 10:54
@zettca zettca requested a review from a team as a code owner May 12, 2026 10:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces direct rollup type imports within the App Shell Vite plugin code and modernizes the shared Vite config to use import.meta.dirname instead of a CJS-style __dirname shim, aiming to keep behavior unchanged while decreasing Rollup-coupled typing.

Changes:

  • Removed rollup-specific type imports (NormalizedOutputOptions, OutputBundle) and relied on Vite-provided typing/context.
  • Updated the cross-origin HTML transform helper to type bundle via IndexHtmlTransformContext["bundle"] and made bundle access null-safe.
  • Refactored the shared .config/vite.config.ts to use import.meta.dirname and simplified path.resolve(...) calls, while inlining Rollup output options.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/app-shell-vite-plugin/src/vite-importmap-plugin.ts Drops direct Rollup output-options type import while keeping the same generateBundle behavior.
packages/app-shell-vite-plugin/src/vite-crossorigin-fix-plugin.ts Replaces Rollup bundle type with Vite’s IndexHtmlTransformContext bundle typing and adds optional bundle access.
packages/app-shell-vite-plugin/src/vite-configuration-processor-plugin.ts Removes Rollup and Vite config type annotations from hook signatures without changing logic.
.config/vite.config.ts Migrates from computed __dirname to import.meta.dirname and consolidates Rollup output config inline.

@zettca zettca merged commit 9acd3c6 into master May 12, 2026
20 of 21 checks passed
@zettca zettca deleted the fix/stuff branch May 12, 2026 14:17
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.

3 participants