diff --git a/patches/sirv@2.0.4.patch b/patches/sirv@2.0.4.patch index d6cf2c64ab7751..e018da163fe0fd 100644 --- a/patches/sirv@2.0.4.patch +++ b/patches/sirv@2.0.4.patch @@ -1,7 +1,14 @@ diff --git a/build.js b/build.js -index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..85b82c90346e829bbf723e913f282c80096df061 100644 +index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..0e2a690abb3bd121f6ba7c0855163b816f5a7a70 100644 --- a/build.js +++ b/build.js +@@ -1,5 +1,5 @@ + const fs = require('fs'); +-const { join, normalize, resolve } = require('path'); ++const { join, normalize, resolve, sep } = require('path'); + const { totalist } = require('totalist/sync'); + const { parse } = require('@polka/url'); + const { lookup } = require('mrmime'); @@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) { } } @@ -19,6 +26,15 @@ index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..85b82c90346e829bbf723e913f282c80 headers = toHeaders(name, stats, isEtag); headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store'; return { abs, stats, headers }; +@@ -161,7 +162,7 @@ module.exports = function (dir, opts={}) { + }); + } + +- let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES); ++ let lookup = opts.dev ? viaLocal.bind(0, dir.endsWith(sep) ? dir : dir + sep, isEtag) : viaCache.bind(0, FILES); + + return function (req, res, next) { + let extns = ['']; @@ -176,7 +177,7 @@ module.exports = function (dir, opts={}) { catch (err) { /* malform uri */ } } @@ -29,9 +45,16 @@ index 0884d9ffaa24d0ae3ec020a6faff12b3125b2071..85b82c90346e829bbf723e913f282c80 if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) { diff --git a/build.mjs b/build.mjs -index c93bbe6bdfb7ad13ee20f0c44d80d6aacdd64087..3dc3e22f09abcae51aef7b75c34dc08b1f6e6abd 100644 +index c93bbe6bdfb7ad13ee20f0c44d80d6aacdd64087..9127789c792ffb23022524fd2a6f997286afe0cf 100644 --- a/build.mjs +++ b/build.mjs +@@ -1,5 +1,5 @@ + import * as fs from 'fs'; +-import { join, normalize, resolve } from 'path'; ++import { join, normalize, resolve, sep } from 'path'; + import { totalist } from 'totalist/sync'; + import { parse } from '@polka/url'; + import { lookup } from 'mrmime'; @@ -35,7 +35,7 @@ function viaCache(cache, uri, extns) { } } @@ -49,6 +72,15 @@ index c93bbe6bdfb7ad13ee20f0c44d80d6aacdd64087..3dc3e22f09abcae51aef7b75c34dc08b headers = toHeaders(name, stats, isEtag); headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store'; return { abs, stats, headers }; +@@ -161,7 +162,7 @@ export default function (dir, opts={}) { + }); + } + +- let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES); ++ let lookup = opts.dev ? viaLocal.bind(0, dir.endsWith(sep) ? dir : dir + sep, isEtag) : viaCache.bind(0, FILES); + + return function (req, res, next) { + let extns = ['']; @@ -176,7 +177,7 @@ export default function (dir, opts={}) { catch (err) { /* malform uri */ } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 428345d8908140..bbde6f84f4aa79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ patchedDependencies: hash: qqiqxx62zlcu62nljjmhlvexni path: patches/http-proxy@1.18.1.patch sirv@2.0.4: - hash: amdes53ifqfntejkflpaq5ifce + hash: owsaynqbfztzqsvxv437uugt5q path: patches/sirv@2.0.4.patch importers: @@ -390,7 +390,7 @@ importers: version: 1.77.8 sirv: specifier: ^2.0.4 - version: 2.0.4(patch_hash=amdes53ifqfntejkflpaq5ifce) + version: 2.0.4(patch_hash=owsaynqbfztzqsvxv437uugt5q) source-map-support: specifier: ^0.5.21 version: 0.5.21 @@ -802,7 +802,7 @@ importers: devDependencies: sirv: specifier: ^2.0.4 - version: 2.0.4(patch_hash=amdes53ifqfntejkflpaq5ifce) + version: 2.0.4(patch_hash=owsaynqbfztzqsvxv437uugt5q) playground/minify: dependencies: @@ -12438,7 +12438,7 @@ snapshots: simple-git-hooks@2.11.1: {} - sirv@2.0.4(patch_hash=amdes53ifqfntejkflpaq5ifce): + sirv@2.0.4(patch_hash=owsaynqbfztzqsvxv437uugt5q): dependencies: '@polka/url': 1.0.0-next.24 mrmime: 2.0.0