170 lines
4.8 KiB
JavaScript
170 lines
4.8 KiB
JavaScript
// next.config.js
|
|
//const withStyles = require("@webdeb/next-styles");
|
|
//const { nextI18NextRewrites } = require("next-i18next/rewrites");
|
|
const nextTranslate = require("next-translate");
|
|
|
|
// module.exports = withStyles({
|
|
// sass: true, // use .scss files
|
|
// modules: true, // style.(m|module).css & style.(m|module).scss for module files
|
|
// sassLoaderOptions: {
|
|
// sassOptions: {
|
|
// includePaths: [
|
|
// "/styles/sass",
|
|
// "node_modules/govuk-frontend/govuk/all",
|
|
// "/styles/sass/patterns",
|
|
// "/styles/sass/welshgov",
|
|
// ], // @import 'variables'; # loads (src/styles/varialbes.scss), you got it..
|
|
// },
|
|
// },
|
|
// });
|
|
|
|
const securityHeaders = [
|
|
{
|
|
key: "X-DNS-Prefetch-Control",
|
|
value: "on",
|
|
},
|
|
{
|
|
key: "X-Frame-Options",
|
|
value: "SAMEORIGIN",
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "X-Permitted-Cross-Domain-Policies",
|
|
value: "none",
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "origin-when-cross-origin", //no-referrer
|
|
},
|
|
{
|
|
key: "Strict-Transport-Security",
|
|
value: "max-age=63072000; includeSubDomains; preload",
|
|
},
|
|
{
|
|
key: "X-XSS-Protection",
|
|
value: "1; mode=block",
|
|
},
|
|
// {
|
|
// key: "Content-Security-Policy",
|
|
// value: "frame-src 'self'; child-src 'self';object-src 'none'; script-src 'self' 'https://www.googletagmanager.com' unsafe-inline",
|
|
// },
|
|
];
|
|
|
|
module.exports = {
|
|
sassOptions: {
|
|
includePaths: [
|
|
"/styles/sass",
|
|
"node_modules/govuk-frontend/govuk/all",
|
|
"/styles/sass/patterns",
|
|
"/styles/sass/welshgov",
|
|
], // @import 'variables'; # loads (src/styles/varialbes.scss), you got it..
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
// Apply these headers to all routes in your application.
|
|
source: "/(.*)?",
|
|
headers: securityHeaders,
|
|
},
|
|
];
|
|
},
|
|
generateBuildId: async () => {
|
|
// You can, for example, get the latest git commit hash here
|
|
return "pinswg-build-id";
|
|
},
|
|
poweredByHeader: false,
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/ceisiadaudns",
|
|
destination: "/dnsapplications",
|
|
},
|
|
{
|
|
source: "/manyliondns",
|
|
destination: "/dnsdetails",
|
|
},
|
|
{
|
|
source: "/canlyniadauchwilio",
|
|
destination: "/searchresults",
|
|
},
|
|
{
|
|
source: "/fymhorth/canlyniadauchwilio",
|
|
destination: "/myportal/searchresults",
|
|
},
|
|
{
|
|
source: "/chwiliouwch",
|
|
destination: "/advancedsearch",
|
|
},
|
|
{
|
|
source: "/fymhorth/chwiliouwch",
|
|
destination: "/myportal/advancedsearch",
|
|
},
|
|
{
|
|
source: "/canlyniadauchwiliouwch",
|
|
destination: "/advancedsearchresults",
|
|
},
|
|
{
|
|
source: "/fymhorth/canlyniadauchwiliouwch",
|
|
destination: "/myportal/advancedsearchresults",
|
|
},
|
|
{
|
|
source: "/fymhorth",
|
|
destination: "/myportal",
|
|
},
|
|
{
|
|
source: "/achos",
|
|
destination: "/case",
|
|
},
|
|
{
|
|
source: "/fymhorth/achos",
|
|
destination: "/myportal/case",
|
|
},
|
|
{
|
|
source: "/allgofnodi",
|
|
destination: "/logout",
|
|
},
|
|
{
|
|
source: "/apelnewydd",
|
|
destination: "/newappeal",
|
|
},
|
|
{
|
|
source: "/apelnewydd/:path*",
|
|
destination: "/newappeal/:path*",
|
|
},
|
|
{
|
|
source: "/cyfrif/cofrestr",
|
|
destination: "/account/register",
|
|
},
|
|
{
|
|
source: "/help/cwcis",
|
|
destination: "/help/cookies",
|
|
},
|
|
{
|
|
source: "/hygyrchedd",
|
|
destination: "/accessibility",
|
|
},
|
|
{
|
|
source: "/preifatrwydd",
|
|
destination: "/privacy",
|
|
},
|
|
{
|
|
source: "/manylion-am-gwcis",
|
|
destination: "/details-about-cookies",
|
|
},
|
|
{
|
|
source: "/telerau-ac-amodau",
|
|
destination: "/terms-and-conditions",
|
|
},
|
|
|
|
// {
|
|
// source: "/cy:path*",
|
|
// destination: "http://cyrmu.local/:path*",
|
|
// },
|
|
];
|
|
},
|
|
...nextTranslate(),
|
|
};
|