-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnext.config.js
84 lines (75 loc) · 1.77 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const path = require("path");
const ghPages = process.env.DEPLOY_TARGET === "gh-pages";
const withPlugins = require("next-compose-plugins");
const MDX = require("@next/mdx");
// next.js configuration
const nextConfig = {
webpack5: false,
webpack: (config, { isServer }) => {
if (!isServer) {
config.node = {
fs: "empty",
};
}
config.resolve.alias.images = path.join(__dirname, "images");
return config;
},
pageExtensions: ["js", "jsx", "md", "mdx"],
target: "serverless",
exportPathMap: function () {
return {
"/": { page: "/" },
"/about": { page: "/about" },
};
},
basePath: ghPages ? "/santhalakshminarayana.github.io/" : "",
assetPrefix: ghPages ? "/santhalakshminarayana.github.io/" : "",
};
module.exports = withPlugins(
[
[
MDX,
{
extension: /\.mdx?$/,
},
],
],
nextConfig
);
/* Next Optimized Images configuration
const optimizedImages = require('next-optimized-images');
// next.js configuration
const nextConfig = {
webpack: (config, { isServer }) => {
if (!isServer) {
config.node = {
fs: 'empty'
}
}
config.resolve.alias.images = path.join(__dirname, "images");
return config
},
pageExtensions: ['js', 'jsx', 'md', 'mdx'],
target: 'serverless',
exportPathMap: function () {
return {
'/': { page: '/' },
'/about': { page: '/about' },
}
},
basePath: ghPages? '/santhalakshminarayana.github.io/' : '',
assetPrefix: ghPages ? '/santhalakshminarayana.github.io/' : '',
}
module.exports = withPlugins([
[optimizedImages, {
removeOriginalExtension: true,
responsive: {
adapter: require('responsive-loader/sharp'),
sizes: [480, 720, 960],
},
}],
[MDX, {
extension: /\.mdx?$/,
}]
], nextConfig)
*/