fix: Production file paths

This commit is contained in:
Tom Moor
2020-08-23 20:35:59 -07:00
parent 1fa3db4bdc
commit 5aa092853b
2 changed files with 3 additions and 6 deletions

View File

@ -18,7 +18,7 @@ const readFile = util.promisify(fs.readFile);
const readIndexFile = async (ctx) => { const readIndexFile = async (ctx) => {
if (isProduction) { if (isProduction) {
return readFile(path.join(__dirname, "../build/app/index.html")); return readFile(path.join(__dirname, "../app/index.html"));
} }
const middleware = ctx.devMiddleware; const middleware = ctx.devMiddleware;
@ -52,10 +52,7 @@ if (process.env.NODE_ENV === "production") {
"Cache-Control": `max-age=${356 * 24 * 60 * 60}`, "Cache-Control": `max-age=${356 * 24 * 60 * 60}`,
}); });
await sendfile( await sendfile(ctx, path.join(__dirname, "../app/", ctx.path.substring(8)));
ctx,
path.join(__dirname, "../build/app/", ctx.path.substring(8))
);
}); });
} }

View File

@ -16,7 +16,7 @@ const prefetchTags = [
try { try {
const manifest = fs.readFileSync( const manifest = fs.readFileSync(
path.join(__dirname, "../../build/app/manifest.json"), path.join(__dirname, "../../app/manifest.json"),
"utf8" "utf8"
); );
const manifestData = JSON.parse(manifest); const manifestData = JSON.parse(manifest);