2
2
mirror of https://github.com/Thream/website.git synced 2024-07-21 09:28:32 +02:00
website/next.config.js

49 lines
1.3 KiB
JavaScript
Raw 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',
...(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
}
})
)