fix: PWA related fixes and mainfest added

This commit is contained in:
sriram veeraghanta 2024-08-01 21:08:57 +05:30
parent c89fe9a313
commit 8924e303da
11 changed files with 68 additions and 19 deletions

View file

@ -2,6 +2,9 @@
/** @type {import("next").NextConfig} */
require("dotenv").config({ path: ".env" });
const { withSentryConfig } = require("@sentry/nextjs");
const withPWA = require("next-pwa")({
dest: "public",
});
const nextConfig = {
trailingSlash: true,
@ -56,7 +59,7 @@ const nextConfig = {
];
},
async rewrites() {
const posthogHost = process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://app.posthog.com"
const posthogHost = process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://app.posthog.com";
const rewrites = [
{
source: "/ingest/static/:path*",
@ -74,7 +77,7 @@ const nextConfig = {
rewrites.push({
source: "/god-mode",
destination: `${GOD_MODE_BASE_URL}/`,
})
});
rewrites.push({
source: "/god-mode/:path*",
destination: `${GOD_MODE_BASE_URL}/:path*`,
@ -113,11 +116,12 @@ const sentryConfig = {
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
};
const config = withPWA(nextConfig);
if (parseInt(process.env.SENTRY_MONITORING_ENABLED || "0", 10)) {
module.exports = withSentryConfig(nextConfig, sentryConfig);
module.exports = withSentryConfig(config, sentryConfig);
} else {
module.exports = nextConfig;
module.exports = config;
}