Skip to content

Commit d8c0ccb

Browse files
committed
fixup!
1 parent 38e642a commit d8c0ccb

File tree

8 files changed

+6
-56
lines changed

8 files changed

+6
-56
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,3 @@ jobs:
7575
with:
7676
name: webpack-stats
7777
path: apps/site/.next/server/webpack-stats.json
78-
79-
- name: Build Next.js (Static Export)
80-
# We want to generate a static build, as it is a requirement of our website.
81-
run: node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }}
82-
env:
83-
# We want to ensure we have enough RAM allocated to the Node.js process
84-
# this should be a last resort in case by any chances the build memory gets too high
85-
# but in general this should never happen
86-
NODE_OPTIONS: '--max_old_space_size=4096'
87-
# We want to ensure that static exports for all locales do not occur on `pull_request` events
88-
# TODO: The output of this is too large, and it crashes the GitHub Runner
89-
NEXT_PUBLIC_STATIC_EXPORT_LOCALE: false # ${{ github.event_name == 'push' }}

apps/site/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import './.next/dev/types/routes.d.ts';
3+
import './.next/types/routes.d.ts';
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/site/next.config.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import createNextIntlPlugin from 'next-intl/plugin';
55

66
import { rehypePlugins, remarkPlugins } from './mdx/plugins.mjs';
77
import { OPEN_NEXT_CLOUDFLARE } from './next.constants.cloudflare.mjs';
8-
import { BASE_PATH, ENABLE_STATIC_EXPORT } from './next.constants.mjs';
8+
import { BASE_PATH } from './next.constants.mjs';
99
import { getImagesConfig } from './next.image.config.mjs';
1010
import { redirects, rewrites } from './next.rewrites.mjs';
1111

@@ -43,15 +43,11 @@ const nextConfig = {
4343
'./node_modules/@types/node/**/*',
4444
],
4545
},
46-
// On static export builds we want the output directory to be "build"
47-
distDir: ENABLE_STATIC_EXPORT ? 'build' : undefined,
48-
// On static export builds we want to enable the export feature
49-
output: ENABLE_STATIC_EXPORT ? 'export' : undefined,
5046
// This configures all the Next.js rewrites, which are used for rewriting internal URLs into other internal Endpoints
5147
// This feature is not supported within static export builds, hence we pass an empty array if static exports are enabled
52-
rewrites: ENABLE_STATIC_EXPORT ? undefined : rewrites,
48+
rewrites,
5349
// This configures all Next.js redirects
54-
redirects: ENABLE_STATIC_EXPORT ? undefined : redirects,
50+
redirects,
5551
// We don't want to run Type Checking on Production Builds
5652
// as we already check it on the CI within each Pull Request
5753
typescript: { ignoreBuildErrors: true },
@@ -60,6 +56,7 @@ const nextConfig = {
6056
typedRoutes: true,
6157
// Experimental Flags
6258
experimental: {
59+
webpackMemoryOptimizations: true,
6360
// Ensure that server-side code is also minified
6461
serverMinification: true,
6562
// Use Workers and Threads for webpack compilation

apps/site/next.constants.mjs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,6 @@ export const IS_DEV_ENV = process.env.NODE_ENV === 'development';
1414
*/
1515
export const VERCEL_ENV = process.env.VERCEL_ENV || undefined;
1616

17-
/**
18-
* This is used for telling Next.js to do a Static Export Build of the Website
19-
*
20-
* This is used for static/without a Node.js server hosting, such as on our
21-
* legacy Website Build Environment on Node.js's DigitalOcean Droplet.
22-
*
23-
* Note that this is a manual Environment Variable defined by us during `npm run deploy`
24-
*/
25-
export const ENABLE_STATIC_EXPORT =
26-
process.env.NEXT_PUBLIC_STATIC_EXPORT === 'true' ||
27-
process.env.NEXT_PUBLIC_STATIC_EXPORT === true;
28-
29-
/**
30-
* This is used to ensure that pages are Static Export for all locales or only
31-
* in the default (`en`) locale.
32-
*
33-
* Note that this is a manual Environment Variable defined by us during the
34-
* build process in CI.
35-
*/
36-
export const ENABLE_STATIC_EXPORT_LOCALE =
37-
process.env.NEXT_PUBLIC_STATIC_EXPORT_LOCALE === 'true' ||
38-
process.env.NEXT_PUBLIC_STATIC_EXPORT_LOCALE === true;
39-
4017
/**
4118
* This is used for any place that requires the full canonical URL path for the Node.js Website (and its deployment), such as for example, the Node.js RSS Feed.
4219
*

apps/site/next.image.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { OPEN_NEXT_CLOUDFLARE } from './next.constants.cloudflare.mjs';
2-
import { ENABLE_STATIC_EXPORT } from './next.constants.mjs';
32

43
const remotePatterns = [
54
'https://avatars.githubusercontent.com/**',
@@ -24,8 +23,6 @@ export const getImagesConfig = () => {
2423
}
2524

2625
return {
27-
// We disable image optimisation during static export builds
28-
unoptimized: ENABLE_STATIC_EXPORT,
2926
// We add it to the remote pattern for the static images we use from multiple sources
3027
// to be marked as safe sources (these come from Markdown files)
3128
remotePatterns: remotePatterns.map(url => new URL(url)),

apps/site/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"cloudflare:deploy": "opennextjs-cloudflare deploy",
1111
"cloudflare:preview": "wrangler dev",
1212
"predeploy": "node --run build:blog-data",
13-
"deploy": "cross-env NEXT_PUBLIC_STATIC_EXPORT=true node --run build",
1413
"predev": "node --run build:blog-data",
1514
"dev": "cross-env NODE_NO_WARNINGS=1 next dev",
1615
"lint": "node --run lint:js && node --run lint:css && node --run lint:md",

apps/site/turbo.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
"env": [
1010
"VERCEL_ENV",
1111
"VERCEL_URL",
12-
"NEXT_PUBLIC_STATIC_EXPORT",
13-
"NEXT_PUBLIC_STATIC_EXPORT_LOCALE",
1412
"NEXT_PUBLIC_BASE_URL",
1513
"NEXT_PUBLIC_DIST_URL",
1614
"NEXT_PUBLIC_DOCS_URL",
@@ -36,8 +34,6 @@
3634
"env": [
3735
"VERCEL_ENV",
3836
"VERCEL_URL",
39-
"NEXT_PUBLIC_STATIC_EXPORT",
40-
"NEXT_PUBLIC_STATIC_EXPORT_LOCALE",
4137
"NEXT_PUBLIC_BASE_URL",
4238
"NEXT_PUBLIC_DIST_URL",
4339
"NEXT_PUBLIC_DOCS_URL",
@@ -57,8 +53,6 @@
5753
"env": [
5854
"VERCEL_ENV",
5955
"VERCEL_URL",
60-
"NEXT_PUBLIC_STATIC_EXPORT",
61-
"NEXT_PUBLIC_STATIC_EXPORT_LOCALE",
6256
"NEXT_PUBLIC_BASE_URL",
6357
"NEXT_PUBLIC_DIST_URL",
6458
"NEXT_PUBLIC_DOCS_URL",
@@ -83,8 +77,6 @@
8377
"env": [
8478
"VERCEL_ENV",
8579
"VERCEL_URL",
86-
"NEXT_PUBLIC_STATIC_EXPORT",
87-
"NEXT_PUBLIC_STATIC_EXPORT_LOCALE",
8880
"NEXT_PUBLIC_BASE_URL",
8981
"NEXT_PUBLIC_DIST_URL",
9082
"NEXT_PUBLIC_DOCS_URL",

apps/site/types/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { useDetectOS } from '#site/hooks';
1+
import type { useDetectOS } from '#site/hooks/client';
22
import type { MarkdownContext } from '#site/types/markdown';
33

44
export type ClientSharedServerContext = MarkdownContext &

0 commit comments

Comments
 (0)