-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
37 lines (31 loc) · 915 Bytes
/
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
const path = require('path');
const { homepage } = require('./package.json');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const { withContentlayer } = require('next-contentlayer');
const isProduction = process.env.NODE_ENV === 'production';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
assetPrefix: isProduction ? homepage : '',
images: {
loader: 'imgix',
path: isProduction ? homepage : 'http://localhost:3000',
},
sassOptions: {
includePaths: [
path.join(__dirname, 'styles'),
path.join(__dirname, 'src/components'),
],
},
webpack: (config) => {
// rules
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
// plugins
config.resolve.plugins.push(new TsconfigPathsPlugin());
return config;
},
};
module.exports = withContentlayer(nextConfig);