Skip to content

Commit

Permalink
fix: serve out of root static file on windows (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
cawa-93 committed Jan 14, 2021
1 parent 54dab71 commit 506bf2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/middlewares/static.ts
Expand Up @@ -60,7 +60,7 @@ export function serveStaticMiddleware(

export function rawFsStaticMiddleware(): Connect.NextHandleFunction {
const fsRoot =
os.platform() == 'win32' ? process.cwd().split(path.sep)[0] : '/'
os.platform() == 'win32' ? process.cwd().split(path.sep)[0] + '/' : '/'
const serveFromRoot = sirv(fsRoot, sirvOptions)

return (req, res, next) => {
Expand Down

0 comments on commit 506bf2d

Please sign in to comment.