1
0
Эх сурвалжийг харах

fix(graphiql-plugin): Fix asset path for pnpm

pnpm does not serve the static files unless we use the "root" option.
Same issue as discussed in #3499
Michael Bromley 8 сар өмнө
parent
commit
882a055ef7

+ 1 - 1
packages/graphiql-plugin/src/plugin.ts

@@ -165,7 +165,7 @@ export class GraphiqlPlugin implements NestModule {
                 const filePath = path.join(distDir, 'assets', assetPath.toString());
 
                 if (fs.existsSync(filePath)) {
-                    return res.sendFile(filePath);
+                    return res.sendFile(assetPath.toString(), { root: path.join(distDir, 'assets') });
                 } else {
                     return res.status(404).send('Asset not found');
                 }