-
-
Notifications
You must be signed in to change notification settings - Fork 435
/
Copy pathnext.config.mjs
39 lines (36 loc) · 1014 Bytes
/
next.config.mjs
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
import withMDX from '@next/mdx';
import withSourceMaps from '@zeit/next-source-maps';
import remarkPlugin from 'remark-gfm'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
export default withMDX({
// Use .md extension
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkPlugin],
},
})(
withSourceMaps({
compiler: {
styledComponents: true,
},
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
poweredByHeader: false,
webpack: function (config, { dev, isServer }) {
if (dev) {
return config;
}
if (!!process.env.ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'disabled',
// For all options see https://github.com/th0r/webpack-bundle-analyzer#as-plugin
generateStatsFile: true,
// Will be available at `.next/stats.json`
statsFilename: 'stats.json',
})
);
}
return config;
},
})
);