-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
40 lines (36 loc) · 1.05 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
/** @type {import('next').NextConfig} */
const path = require('path');
function getEnonicWebpackConfig(config, {buildId, dev, isServer, defaultLoaders, nextRuntime, webpack}) {
config.resolve.fallback = {
...config.resolve.fallback,
// client-side resolution for node modules
fs: false
}
config.resolve.alias = {
...config.resolve.alias,
"@phrases": path.resolve(__dirname, "./src/phrases"),
}
return config;
}
async function getEnonicHeaders() {
return [
{
// Apply these headers to all routes in your application.
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: `script-src 'self' 'unsafe-eval' 'unsafe-inline';`
}
],
},
]
}
const config = {
reactStrictMode: true,
trailingSlash: false,
transpilePackages: ['@enonic/nextjs-adapter'],
webpack: getEnonicWebpackConfig,
headers: getEnonicHeaders,
};
module.exports = config;