Pārlūkot izejas kodu

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 mēneši atpakaļ
vecāks
revīzija
882a055ef7
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      packages/graphiql-plugin/src/plugin.ts

+ 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');
                 }