0.4.0 convex及界面修改
This commit is contained in:
@@ -1,4 +1,28 @@
|
||||
import type { NextConfig } from "next";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
function loadEnvAll() {
|
||||
// 约定:全局仅使用仓库根目录的 .env.all 作为配置来源(生产优先)。
|
||||
// 说明:这里仅“补齐缺失项”,避免覆盖系统环境变量(方便部署/容器注入)。
|
||||
const envAllPath = path.resolve(__dirname, "..", ".env.all");
|
||||
if (!fs.existsSync(envAllPath)) return;
|
||||
const raw = fs.readFileSync(envAllPath, { encoding: "utf8" });
|
||||
for (const line of raw.split(/\r?\n/)) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed || trimmed.startsWith("#")) continue;
|
||||
const idx = trimmed.indexOf("=");
|
||||
if (idx === -1) continue;
|
||||
const key = trimmed.slice(0, idx).trim();
|
||||
const value = trimmed.slice(idx + 1).trim();
|
||||
if (!key) continue;
|
||||
if (process.env[key] === undefined) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadEnvAll();
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// 供桌面端打包使用(Electron 内置 Next server.js + 最小依赖)。
|
||||
@@ -24,6 +48,11 @@ const nextConfig: NextConfig = {
|
||||
source: "/_next/static/media/:path*",
|
||||
headers: [{ key: "Cache-Control", value: "public, max-age=31536000, immutable" }],
|
||||
},
|
||||
// Luckysheet 静态资源:文件位于 public/luckysheet,路径稳定(并且我们在 URL 上追加了版本参数),可长期缓存。
|
||||
{
|
||||
source: "/luckysheet/:path*",
|
||||
headers: [{ key: "Cache-Control", value: "public, max-age=31536000, immutable" }],
|
||||
},
|
||||
{
|
||||
source: "/onlyoffice/plugins/:path*",
|
||||
headers: [
|
||||
|
||||
Reference in New Issue
Block a user