-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
next.config.js
59 lines (53 loc) · 1.37 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
58
59
/* eslint-disable @typescript-eslint/no-var-requires */
require('dotenv').config();
const path = require('path');
const nextConfig = {
images: {
disableStaticImages: true, // We inline images ourselves for PDF compatibility
},
eslint: {
ignoreDuringBuilds: true,
},
env: {
WEBSITE_URL: process.env.WEBSITE_URL,
API_URL: process.env.API_URL,
API_KEY: process.env.API_KEY,
LOG_LEVEL: process.env.LOG_LEVEL,
},
rewrites: async () => {
return [
{
source: '/tax-form/:filename',
destination: '/api/tax-form/:filename',
},
];
},
webpack: (config) => {
// See https://styled-components.com/docs/faqs#how-can-i-fix-issues-when-using-npm-link-or-yarn-link
config.resolve.alias['styled-components'] = path.join(__dirname, 'node_modules/styled-components');
// Inline images
config.module.rules.push({
test: /\.(jpg|gif|png|svg|)$/,
use: {
loader: 'url-loader',
options: {
limit: 1000000,
fallback: 'file-loader',
},
},
include: [path.resolve(__dirname, 'public')],
});
// Inline fonts
config.module.rules.push({
test: /\.(ttf|eot|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 750000, // 1mo
},
},
});
return config;
},
};
module.exports = nextConfig;