File tree Expand file tree Collapse file tree 3 files changed +15
-22
lines changed Expand file tree Collapse file tree 3 files changed +15
-22
lines changed Original file line number Diff line number Diff line change 11NEXT_PUBLIC_SITE_HOST = https://example.com
2- NEXT_PUBLIC_SITE_DOMAIN = example.com
2+ NEXT_PUBLIC_IMAGE_DOMAIN = example.com
33
44# http 无法访问 https,也可使用 next dev --experimental-https 生成证书
55NODE_TLS_REJECT_UNAUTHORIZED = 0
Original file line number Diff line number Diff line change 11export default function Loading ( ) {
22 return (
3- < div className = "mt -16 flex flex-col items-center justify-center space-y-2" >
3+ < div className = "my -16 flex flex-col items-center justify-center space-y-2" >
44 < div className = "inline-block size-12 animate-spin rounded-full border-[3px] border-t-slate-400" > </ div >
55 < span > Loading...</ span >
66 </ div >
Original file line number Diff line number Diff line change 11import type { NextConfig } from 'next' ;
2+ import type { RemotePattern } from 'next/dist/shared/lib/image-config' ;
3+
4+ const imageRemotes : RemotePattern [ ] = [
5+ 'testingcf.jsdelivr.net' ,
6+ 'cdn.jsdelivr.net' ,
7+ process . env . NEXT_PUBLIC_IMAGE_DOMAIN || '' ,
8+ ] . map ( ( hostname ) => ( {
9+ protocol : 'https' ,
10+ hostname,
11+ port : '' ,
12+ pathname : '/**' ,
13+ } ) ) ;
214
315const nextConfig : NextConfig = {
416 output : 'standalone' ,
@@ -7,26 +19,7 @@ const nextConfig: NextConfig = {
719 // https://github.com/hashicorp/next-mdx-remote?tab=readme-ov-file#installation
820 transpilePackages : [ 'next-mdx-remote' ] ,
921 images : {
10- remotePatterns : [
11- {
12- protocol : 'https' ,
13- hostname : 'testingcf.jsdelivr.net' ,
14- port : '' ,
15- pathname : '/**' ,
16- } ,
17- {
18- protocol : 'https' ,
19- hostname : 'cdn.jsdelivr.net' ,
20- port : '' ,
21- pathname : '/**' ,
22- } ,
23- {
24- protocol : 'https' ,
25- hostname : process . env . NEXT_PUBLIC_SITE_DOMAIN || '' ,
26- port : '' ,
27- pathname : '/**' ,
28- } ,
29- ] ,
22+ remotePatterns : imageRemotes ,
3023 } ,
3124 async headers ( ) {
3225 return [
You can’t perform that action at this time.
0 commit comments