-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
42 lines (39 loc) · 1.04 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
const packageFile = require('./package.json');
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [],
},
});
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: '/imgreview',
reactStrictMode: true,
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
env: {
appVersion: packageFile.version,
},
// https://nextjs.org/docs/api-reference/next.config.js/exportPathMap
exportPathMap: async () => ({
'/': { page: '/' },
'/about/index': { page: '/about' },
'/features/index': { page: '/features' },
}),
images: {
loader: 'custom',
// https://github.com/vercel/next.js/issues/26527#issuecomment-872044613
disableStaticImages: true,
},
webpack: (config) => {
config.module.rules.push({
test: /.(png|jpe?g|gif|ico|svg)$/,
type: 'asset/resource',
generator: {
filename: './static/assets/[name]-[contenthash][ext]',
},
});
return config;
},
};
module.exports = withMDX(nextConfig);