Skip to content

fix(vite-plugin): normalize wrangler asset directory path separators for Windows compatibility#13188

Merged
jamesopstad merged 2 commits intocloudflare:mainfrom
shulaoda:04-01-fix_vite-plugin_normalize_wrangler_asset_directory_path_separators_for_windows_compatibility
Apr 1, 2026
Merged

fix(vite-plugin): normalize wrangler asset directory path separators for Windows compatibility#13188
jamesopstad merged 2 commits intocloudflare:mainfrom
shulaoda:04-01-fix_vite-plugin_normalize_wrangler_asset_directory_path_separators_for_windows_compatibility

Conversation

@shulaoda
Copy link
Copy Markdown
Contributor

@shulaoda shulaoda commented Apr 1, 2026

Fixes #13185.

  • Normalize the return value of getAssetsDirectory() with vite.normalizePath() to ensure assets.directory in the output wrangler.json always uses forward slashes
  • On Windows, path.relative() returns backslash-separated paths (e.g. ..\client), producing invalid paths in the platform-agnostic config file

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: windows compatibility

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@shulaoda shulaoda requested a review from a team as a code owner April 1, 2026 12:05
@shulaoda shulaoda requested a review from edmundhung April 1, 2026 12:05
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

🦋 Changeset detected

Latest commit: 3bee0f9

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@shulaoda shulaoda marked this pull request as draft April 1, 2026 12:06
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 1, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@shulaoda shulaoda marked this pull request as ready for review April 1, 2026 12:07
@shulaoda shulaoda force-pushed the 04-01-fix_vite-plugin_normalize_wrangler_asset_directory_path_separators_for_windows_compatibility branch from 50a32d0 to be51a4b Compare April 1, 2026 12:08
@shulaoda shulaoda force-pushed the 04-01-fix_vite-plugin_normalize_wrangler_asset_directory_path_separators_for_windows_compatibility branch from be51a4b to 08f1836 Compare April 1, 2026 12:10
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 1, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13188

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13188

miniflare

npm i https://pkg.pr.new/miniflare@13188

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13188

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13188

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13188

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13188

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13188

wrangler

npm i https://pkg.pr.new/wrangler@13188

commit: 3bee0f9

Copy link
Copy Markdown
Contributor

@jamesopstad jamesopstad left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 1, 2026
@jamesopstad jamesopstad merged commit 110002c into cloudflare:main Apr 1, 2026
47 of 48 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 1, 2026
emily-shen pushed a commit that referenced this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

getAssetsDirectory produces backslash paths in wrangler.json on Windows

3 participants