This commit is contained in:
parent
1ecbdcb984
commit
c670150d1d
|
|
@ -5,18 +5,19 @@
|
||||||
我们在此处强制同步加载 /env.js 用于注入 window.RUNTIME_ENV,
|
我们在此处强制同步加载 /env.js 用于注入 window.RUNTIME_ENV,
|
||||||
以确保运行时 Supabase 等动态配置在 React 启动前就可用。
|
以确保运行时 Supabase 等动态配置在 React 启动前就可用。
|
||||||
*/
|
*/
|
||||||
import { Html, Head, Main, NextScript } from "next/document"
|
import { Html, Head, Main, NextScript } from "next/document";
|
||||||
|
|
||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head>
|
<Head>
|
||||||
|
{/* 使用 defer 确保 env.js 加载顺序 */}
|
||||||
|
<script src="/env.js" defer />
|
||||||
</Head>
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
</body>
|
</body>
|
||||||
</Html>
|
</Html>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue