forked from saleor/saleor-storefront
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
41 lines (39 loc) · 1.28 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const withPlugins = require("next-compose-plugins");
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
const withOptimizedImages = require("next-optimized-images");
const withTM = require("next-transpile-modules")(["register-service-worker"]);
const withServiceWorkerConfig = require("./config/next/config.serviceWorker");
const withBaseConfig = require("./config/next/config.base");
const withDevConfig = require("./config/next/config.dev");
const withProdConfig = require("./config/next/config.prod");
module.exports = withPlugins(
[
[withOptimizedImages, { handleImages: ["jpeg", "png", "webp", "gif"] }],
withTM,
withBaseConfig,
withServiceWorkerConfig,
[withDevConfig, {}, [PHASE_DEVELOPMENT_SERVER]],
[withProdConfig, {}, ["!" + PHASE_DEVELOPMENT_SERVER]],
],
{
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "x-content-type-options",
value: "nosniff",
},
{ key: "x-xss-protection", value: "1" },
{ key: "x-frame-options", value: "DENY" },
{
key: "strict-transport-security",
value: "max-age=31536000; includeSubDomains",
},
],
},
];
},
}
);