Skip to content

Commit ba11d4b

Browse files
committed
f
1 parent 8cb3cbd commit ba11d4b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export function staticCache(
188188

189189
// decode for `/%E4%B8%AD%E6%96%87`
190190
// normalize for `//index`
191-
let filename = path.posix.normalize(safeDecodeURIComponent(ctx.path));
191+
let filename = path.normalize(safeDecodeURIComponent(ctx.path));
192192

193193
// check alias
194194
if (options.alias && options.alias[filename]) {

test/index.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const files: Record<string, any> = {};
1818
app.use(staticCache(path.join(__dirname, '..'), {
1919
alias: {
2020
'/package': '/package.json',
21+
// windows
22+
'\\package': '/package.json',
2123
},
2224
filter(file: string) {
2325
return !file.includes('node_modules');

0 commit comments

Comments
 (0)