Skip to content

Fix svelte transformer#1357

Merged
ije merged 2 commits into
mainfrom
fix-svelte-transformer
May 12, 2026
Merged

Fix svelte transformer#1357
ije merged 2 commits into
mainfrom
fix-svelte-transformer

Conversation

@ije
Copy link
Copy Markdown
Member

@ije ije commented May 12, 2026

close #1233

Copilot AI review requested due to automatic review settings May 12, 2026 01:44
Copy link
Copy Markdown

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 aims to fix the Svelte loader/transformer so that relative imports inside transformed .svelte files resolve correctly during esbuild bundling, addressing issue #1233, and adds a regression test.

Changes:

  • Set ResolveDir on the esbuild OnLoad results for the Svelte and Vue SFC loaders.
  • Add a Deno integration test intended to cover issue #1233.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
server/build.go Adds ResolveDir to Svelte/Vue esbuild OnLoad results to enable resolving relative imports from transformed SFC code.
test/issue-1233/test.ts Adds a regression test that fetches a .svelte file from @onsvisual/svelte-components and checks the transformed output references the expected dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/build.go
Comment thread server/build.go
Comment thread test/issue-1233/test.ts
@ije ije merged commit 8985067 into main May 12, 2026
9 checks passed
@ije ije deleted the fix-svelte-transformer branch May 12, 2026 02:11
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.

Failed to import - https://esm.sh/gh/ONSdigital/svelte-components/src/lib/layout/Section/Section.svelte

2 participants