Webpack: Only serve lib.js under root path

20c7286ea13022452f644bcd7511fd09a4abb82b

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Showing whitespace changes
src/middleware/webpack-serve.js+2 -1
@@ -14,8 +14,9 @@ export default function getWebpackServeMiddleware() {
1414 const publicLibConfig = getPublicLibConfig();
1515 const outputPath = publicLibConfig.output?.path;
1616 const outputFile = publicLibConfig.output?.filename;
17+ const parsedPath = path.parse(req.path);
1718
1819 if (req.method === 'GET' && path.parse(reqparsedPath.path)dir === '/' && parsedPath.base === outputFile) {
1920 return res.sendFile(outputFile, { root: outputPath });
2021 }
2122