This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/next.config.js

50 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2021-10-24 05:19:39 +02:00
const nextPWA = require('next-pwa')
2021-10-24 05:48:06 +02:00
const nextTranslate = require('next-translate')
2021-12-28 16:06:58 +01:00
const { createSecureHeaders } = require('next-secure-headers')
2021-10-24 05:19:39 +02:00
/** @type {import("next").NextConfig} */
2021-10-24 05:19:39 +02:00
module.exports = nextTranslate(
nextPWA({
2021-10-26 16:38:55 +02:00
images: {
domains: [
'api.thream.divlo.fr',
'thream-api.herokuapp.com',
2022-04-08 20:59:04 +02:00
'file-uploads-api.thream.divlo.fr',
...(process.env.NODE_ENV !== 'production' ? ['localhost'] : [])
2021-10-26 16:38:55 +02:00
]
2021-12-28 16:06:58 +01:00
},
reactStrictMode: true,
pwa: {
disable: process.env.NODE_ENV !== 'production',
dest: 'public'
},
headers() {
2021-12-28 16:06:58 +01:00
return [
{
source: '/:path*',
headers: createSecureHeaders({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: [
"'self'",
'data:',
"'unsafe-eval'",
"'unsafe-inline'"
],
2021-12-28 16:06:58 +01:00
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ['*', 'data:', 'blob:'],
mediaSrc: ['*', 'data:', 'blob:'],
2021-12-28 16:06:58 +01:00
connectSrc: '*',
objectSrc: "'none'",
fontSrc: "'self'",
baseURI: "'none'"
}
}
})
}
]
2021-10-24 05:19:39 +02:00
}
})
)