-
Notifications
You must be signed in to change notification settings - Fork 9
/
next.config.js
55 lines (52 loc) · 1.12 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
require('dotenv').config({ path: `${process.env.ENVIRONMENT}` });
const path = require('path');
module.exports = {
async rewrites() {
return [
// Rewrite everything else to use `pages/index`
{
source: '/:path*',
destination: '/',
},
];
},
future: {
webpack5: true,
},
images: {
loader: 'imgix',
path: 'https://caspermember.com/',
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
// trailingSlash: true,
webpack: config => {
config.module.rules.push({
test: /\.(png|jp(e*)g|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: 'images/[hash]-[name].[ext]',
outputPath: 'static/images',
publicPath: `/_next/static/images/`,
},
},
],
});
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
return config;
},
webpackDevMiddleware: config => {
const newConfig = config;
newConfig.watchOptions = {
aggregateTimeout: 300,
poll: 1000,
};
return newConfig;
},
};