Skip to content

Commit

Permalink
fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Mar 19, 2024
1 parent 912326a commit 87ddbc9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/vite/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,15 @@ export function assets(): Plugin {
publicDir = server.config.publicDir;
return () => {
server.middlewares.use((req, res, next) => {
if (req.originalUrl?.includes('?')) {
return next();
}
if (req.originalUrl && req.originalUrl.length > 1) {
const assetUrl = findPublicAsset(req.originalUrl, resolverLoader.resolver);
const assetUrl = findPublicAsset(req.originalUrl.split('?')[0], resolverLoader.resolver);
if (assetUrl) {
return send(req as Readable, assetUrl).pipe(res);
}
}
return next();
});
}
};
},
async buildStart() {
if (mode !== 'build') return;
Expand Down

0 comments on commit 87ddbc9

Please sign in to comment.