Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nlfy #3883

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ interface ProfileParams extends ParsedUrlQuery {
}

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

export async function getStaticProps({
Expand Down
21 changes: 21 additions & 0 deletions packages/webapp/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ const nextConfig: NextConfig = {
},
];

if (process.env.REWRITE_DEPLOYMENT_URL) {
return {
beforeFiles: [
{
source: '/:path*',
destination: `${process.env.REWRITE_DEPLOYMENT_URL}/:path*`,
},
],
afterFiles: rewrites,
fallback: [
{
source: '/:path*',
destination: `${process.env.REWRITE_DEPLOYMENT_URL}/:path*`,
},
],
};
}

// to support GitPod environment and avoid CORS issues, we need to proxy the API requests
if (process.env.NEXT_PUBLIC_DOMAIN === 'localhost') {
rewrites.unshift({
Expand Down Expand Up @@ -181,6 +199,9 @@ const nextConfig: NextConfig = {
poweredByHeader: false,
reactStrictMode: false,
productionBrowserSourceMaps: process.env.SOURCE_MAPS === 'true',
generateBuildId: async () => {
return process.env.COMMIT_REF || process.env.VERCEL_GIT_COMMIT_SHA;
},
}),
}),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/backoffice/keywords/[value].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ KeywordPage.getLayout = getMainLayout;
export default KeywordPage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface KeywordParams extends ParsedUrlQuery {
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/posts/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ PostPage.layoutProps = {
export default PostPage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

export async function getStaticProps({
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/sources/[source].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ SourcePage.layoutProps = {
export default SourcePage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface SourcePageParams extends ParsedUrlQuery {
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/squads/[handle]/[token].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ SquadReferral.layoutProps = { showSidebar: false };
export default SquadReferral;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

export async function getStaticProps({
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/squads/[handle]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ EditSquad.getLayout = getMainLayout;
EditSquad.layoutProps = { seo };

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface SquadPageParams extends ParsedUrlQuery {
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/squads/[handle]/moderate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function ModerateSquadPage({
}

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface SquadPageParams extends ParsedUrlQuery {
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/tags/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ TagPage.layoutProps = mainFeedLayoutProps;
export default TagPage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface TagPageParams extends ParsedUrlQuery {
Expand Down
Loading