web-humas-fe/next.config.js

81 lines
1.6 KiB
JavaScript

// next.config.js
// const withPWA = require("next-pwa")({
// dest: "public",
// register: true,
// skipWaiting: true,
// // disable: process.env.NODE_ENV === "development", // disable PWA di mode dev
// });
/** @type {import('next').NextConfig} */
const path = require("path");
const nextConfig = {
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
],
},
{
source: "/sw.js",
headers: [
{
key: "Content-Type",
value: "application/javascript; charset=utf-8",
},
{
key: "Cache-Control",
value: "no-cache, no-store, must-revalidate",
},
{
key: "Content-Security-Policy",
value: "default-src 'self'; script-src 'self'",
},
],
},
];
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
serverActions: true,
pwa: {
dest: "public",
register: true,
skipWaiting: true,
},
},
images: {
remotePatterns: [
{
hostname: "*",
},
],
},
webpack: (config) => {
config.resolve.alias["ckeditor5-custom-build"] = path.resolve(
__dirname,
"vendor/ckeditor5"
);
return config;
},
};
// module.exports = withPWA(nextConfig);
module.exports = nextConfig;