MEGAINFRA-WEBAPP/next.config.js

72 lines
1.9 KiB
JavaScript
Raw Normal View History

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: "standalone",
images: {
remotePatterns: [
// Allow image optimisation from any host. Lock this down once we
// know exactly which sources we'll pull attachments from.
{ protocol: "http", hostname: "**" },
{ protocol: "https", hostname: "**" },
],
},
// Allow any host / IP / tunneled domain so the app is reachable from
// LAN devices, reverse proxies and custom hostnames. Next 16's
// internal matcher rejects the literal "*", so we also rely on the
// `scripts/patch-next-dev-blocker.cjs` postinstall hook to neuter
// the dev-only cross-site guard. Production behaviour is unaffected
// because the patch only runs in development.
allowedDevOrigins: ["*"],
experimental: {
serverActions: {
allowedOrigins: ["*"],
},
},
};
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
register: true,
workboxOptions: {
cleanupOutdatedCaches: true,
clientsClaim: true,
skipWaiting: true,
},
manifest: {
name: "MEGA INFRASTRUCTURE",
short_name: "MEGA",
description: "Construction site operations dashboard for fuel, orders, and workforce.",
theme_color: "#fdb13c",
background_color: "#e8ebed",
display: "standalone",
orientation: "portrait",
scope: "/",
start_url: "/dashboard",
icons: [
{
src: "/icons/icon-192.png",
sizes: "192x192",
type: "image/png",
purpose: "any",
},
{
src: "/icons/icon-512.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/icons/maskable-512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
});
module.exports = withPWA(nextConfig);