Skip to content

fix: copy public directory assets if client build is skipped - #16004

Merged
teemingc merged 3 commits into
mainfrom
fix-ssr-public-assets
Jun 10, 2026
Merged

fix: copy public directory assets if client build is skipped#16004
teemingc merged 3 commits into
mainfrom
fix-ssr-public-assets

Conversation

@teemingc

@teemingc teemingc commented Jun 10, 2026

Copy link
Copy Markdown
Member

Assets in the public directory static are not copied to the output/client directory during the server build. This means if the client build is skipped (which is now possible because of #15936), the public assets are never copied over.

This PR manually copies these assets over because setting the Vite option copyPublicDir: true simply copies them to the output/server directory.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

No changeset because #15936 hasn't been released yet.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c10b983

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

expect(img_response.status()).toBe(200);

const public_asset_response = await request.get('/asset.json');
expect(public_asset_response.status()).toBe(200);

@teemingc teemingc Jun 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The test checks that the public assets are accessible after build

@svelte-docs-bot

Copy link
Copy Markdown

@teemingc teemingc mentioned this pull request Jun 10, 2026

@Rich-Harris Rich-Harris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good save!

@teemingc
teemingc merged commit 607713e into main Jun 10, 2026
49 of 50 checks passed
@teemingc
teemingc deleted the fix-ssr-public-assets branch June 10, 2026 14:01
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