You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request is the opposite of #92 and much easier to implement than that one
I'd like an option to only serve a file if the case matches what's on the filesystem. That's how it works on Linux, but Mac and Windows have a different behavior. It'd be nice to have the ability to enforce a consistent behavior.
SvelteKit has this implementation:
/**
* Determine if a file is being requested with the correct case,
* to ensure consistent behaviour between dev and prod and across
* operating systems. Note that we can't use realpath here,
* because we don't want to follow symlinks
* @param {string} file
* @param {string} assets
* @returns {boolean}
*/
function has_correct_case(file, assets) {
if (file === assets) return true;
const parent = path.dirname(file);
if (fs.readdirSync(parent).includes(path.basename(file))) {
return has_correct_case(parent, assets);
}
return false;
}
However, I'd like it to live in sirv so that we can use it in Vite as well
The text was updated successfully, but these errors were encountered:
This request is the opposite of #92 and much easier to implement than that one
I'd like an option to only serve a file if the case matches what's on the filesystem. That's how it works on Linux, but Mac and Windows have a different behavior. It'd be nice to have the ability to enforce a consistent behavior.
SvelteKit has this implementation:
However, I'd like it to live in
sirv
so that we can use it in Vite as wellThe text was updated successfully, but these errors were encountered: