Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit fcec8cc

Browse files
authored
Merge pull request #12 from DeterminateSystems/fix-deploy-previews
Fix Netlify deploy previews
2 parents ebf1e49 + cddc376 commit fcec8cc

File tree

4 files changed

+976
-706
lines changed

4 files changed

+976
-706
lines changed

netlify.toml

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
[build]
22
command = "pnpm run build"
33
publish = "out"
4+
5+
[build.environment]
46
NODE_ENV = "production"
57

8+
[context.production.environment]
9+
PREVIEW = "false"
10+
11+
[context.branch-deploy.environment]
12+
PREVIEW = "true"
13+
14+
[context.deploy-preview.environment]
15+
PREVIEW = "true"

next.config.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nextra from "nextra";
22

3-
const isProd = process.env.NODE_ENV === "production";
3+
const isPreview = process.env.PREVIEW === "true";
44

55
const withNextra = nextra({
66
codeHighlight: true,
@@ -10,8 +10,8 @@ const withNextra = nextra({
1010
});
1111

1212
export default withNextra({
13-
assetPrefix: isProd ? "https://flakehub.com/docs" : undefined,
14-
basePath: isProd ? "/docs" : undefined,
13+
assetPrefix: isPreview ? undefined : "https://flakehub.com/docs",
14+
basePath: isPreview ? undefined : "/docs",
1515
images: {
1616
unoptimized: true,
1717
},

package.json

+16-18
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,23 @@
77
"format": "prettier --write ."
88
},
99
"dependencies": {
10-
"@tailwindcss/typography": "^0.5.10",
11-
"clsx": "^2.0.0",
12-
"isomorphic-dompurify": "^1.9.0",
13-
"marked": "^5.1.2",
14-
"next": "^14.1.1",
15-
"nextra": "^2.13.2",
16-
"nextra-theme-docs": "^2.13.2",
17-
"react": "^18.2.0",
18-
"react-dom": "^18.2.0",
19-
"react-icons": "^4.11.0"
20-
},
21-
"devDependencies": {
10+
"@tailwindcss/typography": "^0.5.13",
2211
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
23-
"@types/node": "^20.9.0",
24-
"autoprefixer": "^10.4.16",
25-
"postcss": "^8.4.31",
26-
"prettier": "^3.1.0",
27-
"prettier-plugin-tailwindcss": "^0.5.7",
28-
"tailwindcss": "^3.3.5",
12+
"@types/node": "^20.12.12",
13+
"autoprefixer": "^10.4.19",
14+
"clsx": "^2.1.1",
15+
"isomorphic-dompurify": "^1.13.0",
16+
"marked": "^5.1.2",
17+
"next": "^14.2.3",
18+
"nextra": "^2.13.4",
19+
"nextra-theme-docs": "^2.13.4",
20+
"postcss": "^8.4.38",
21+
"prettier": "^3.2.5",
22+
"prettier-plugin-tailwindcss": "^0.5.14",
23+
"react": "^18.3.1",
24+
"react-dom": "^18.3.1",
25+
"react-icons": "^4.12.0",
26+
"tailwindcss": "^3.4.3",
2927
"typescript": "5.2.2"
3028
}
3129
}

0 commit comments

Comments
 (0)