fix: Production file paths
This commit is contained in:
@ -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))
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user