-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
57 lines (55 loc) · 1.33 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
const withPlugins = require("next-compose-plugins");
const optimizedImages = require("next-optimized-images");
const images = require("remark-images");
const withMDX = require("@zeit/next-mdx")({
extension: /\.mdx?$/,
options: {
mdPlugins: [images]
}
});
const withBundleAnalyzer = require("@zeit/next-bundle-analyzer");
// https://arunoda.me/blog/ssr-and-server-only-modules
const nextConfig = {
target: "serverless"
};
module.exports = withPlugins(
[
[
optimizedImages,
{
handleImages: ["jpeg", "png"],
optimizeImagesInDev: true,
responsive: {
adapter: require("responsive-loader/sharp"),
sizes: [180, 360, 600, 760, 1000]
}
}
],
[
withMDX,
{
pageExtensions: ["js", "jsx", "mdx"]
}
],
[
withBundleAnalyzer,
{
analyzeServer: ["server", "both"].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ["browser", "both"].includes(
process.env.BUNDLE_ANALYZE
),
bundleAnalyzerConfig: {
server: {
analyzerMode: "static",
reportFilename: "../bundles/server.html"
},
browser: {
analyzerMode: "static",
reportFilename: "../bundles/client.html"
}
}
}
]
],
nextConfig
);