forked from osmium-blog/osmium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
55 lines (54 loc) · 1.34 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const config = require('./osmium-config.json')
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
appDir: true,
},
basePath: config.path,
images: {
domains: ['gravatar.com'],
},
async headers () {
return [
{
source: '/:path*{/}?',
headers: [
{
key: 'Permissions-Policy',
value: 'interest-cohort=()',
},
],
},
]
},
webpack: config => {
const rules = config.module.rules.find(r => r.oneOf)
rules.oneOf.forEach(loaders => {
if (Array.isArray(loaders.use)) {
loaders.use.forEach(l => {
if (
typeof l !== 'string' &&
typeof l.loader === 'string' &&
/(?<!post)css-loader/.test(l.loader)
) {
if (!l.options.modules) return
const { getLocalIdent, ...others } = l.options.modules
l.options = {
...l.options,
modules: {
...others,
getLocalIdent: (ctx, localIdentName, localName) => {
return localName === 'dark'
? localName
: getLocalIdent(ctx, localIdentName, localName)
},
},
}
}
})
}
})
return config
},
transpilePackages: ['dayjs'],
}