forked from Blazity/next-saas-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
30 lines (27 loc) · 751 Bytes
/
next.config.js
File metadata and controls
30 lines (27 loc) · 751 Bytes
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
const CopyPlugin = require('copy-webpack-plugin');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({
reactStrictMode: true,
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
images: {
domains: ['github.blog'],
deviceSizes: [320, 640, 1080, 1200],
imageSizes: [64, 128],
},
swcMinify: true,
compiler: {
styledComponents: true,
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.svg$/,
issuer: {
and: [/\.(js|ts)x?$/],
},
use: [{ loader: '@svgr/webpack' }, { loader: 'url-loader' }],
});
return config;
},
});