Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong asset files paths on Windows in 0.3.0 #6

Closed
Aexylus opened this issue Feb 17, 2022 · 2 comments
Closed

Wrong asset files paths on Windows in 0.3.0 #6

Aexylus opened this issue Feb 17, 2022 · 2 comments

Comments

@Aexylus
Copy link
Contributor

Aexylus commented Feb 17, 2022

Describe the bug

  // asset-files.ts / collectAssetFiles()
  return files.map((file) => ({
    path: "/" + relative(folder, file),
    content: () => readFile(file),
  }))

This produces wrong file paths on Windows because fast-glob will return paths such as

C:/my-desktop-app/public/build/entry.client-WZGREWZ5.js

and path.relative mangles it into

/build\\entry.client-WZGREWZ5.js

Quick solution for me was to replace the slashes relative(folder, path).replace(/\\/g, '/') but normalize-path or unixify mentioned in fast-glob readme might be a more robust solution.

Minimal Reproduction

~

Steps to Reproduce the Bug or Issue

~

Expected behavior

~

Screenshots or Videos

No response

Platform

  • OS: Windows 10

Additional context

No response

@itsMapleLeaf
Copy link
Owner

Thanks for reporting this! I'll have a fix up in a bit.

@itsMapleLeaf
Copy link
Owner

Fixed and released in 0.3.1

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

No branches or pull requests

2 participants