Skip to content

Commit 0929011

Browse files
authored
Merge pull request #11 from codust-dev/cloudfront
cloudfront changes
2 parents 3df2a07 + 9760213 commit 0929011

File tree

7 files changed

+24912
-12500
lines changed

7 files changed

+24912
-12500
lines changed

.cloudflare/pages.toml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[build]
2+
command = "npm run build"
3+
publish = ".next"
4+
5+
[build.environment]
6+
NODE_VERSION = "20"
7+
8+
[site]
9+
bucket = ".next"
10+
entry-point = "."
11+
12+
[env.production]
13+
name = "codust-dev"
14+
route = "codust.dev/*"
15+
zone_id = "your-zone-id"
16+
17+
[env.preview]
18+
name = "codust-dev-preview"
19+
route = "preview.codust.dev/*"
20+
zone_id = "your-zone-id"

next.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { withContentlayer } = require('next-contentlayer2')
2+
const { setupDevPlatform } = require('@cloudflare/next-on-pages/next-dev')
23

34
const withBundleAnalyzer = require('@next/bundle-analyzer')({
45
enabled: process.env.ANALYZE === 'true',
@@ -61,7 +62,12 @@ const unoptimized = process.env.UNOPTIMIZED ? true : undefined
6162
/**
6263
* @type {import('next/dist/next-server/server/config').NextConfig}
6364
**/
64-
module.exports = () => {
65+
module.exports = async () => {
66+
// Setup Cloudflare Pages development platform
67+
if (process.env.NODE_ENV === 'development') {
68+
await setupDevPlatform()
69+
}
70+
6571
const plugins = [withContentlayer, withBundleAnalyzer]
6672
return plugins.reduce((acc, next) => next(acc), {
6773
output,

0 commit comments

Comments
 (0)