feat: #1000 client-side only and desktop app

This commit is contained in:
Yidadaa
2023-06-07 23:47:21 +08:00
parent 2516851056
commit a023308d52
25 changed files with 3698 additions and 14 deletions

View File

@@ -1,7 +1,21 @@
/** @type {import('next').NextConfig} */
const mode = process.env.BUILD_MODE ?? "standalone";
console.log("[Next] build mode", mode);
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
output: mode,
};
if (mode !== "export") {
nextConfig.rewrites = async () => {
const ret = [
{
source: "/api/proxy/:path*",
@@ -29,16 +43,7 @@ const nextConfig = {
return {
beforeFiles: ret,
};
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
return config;
},
output: "standalone",
};
};
}
export default nextConfig;