forked from opencollective/opencollective-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
44 lines (38 loc) · 1.07 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
require('dotenv').config();
const path = require('path');
const withTM = require('next-transpile-modules')(['@opencollective/frontend-components']);
const nextConfig = {
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,
},
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: /public\/.*\.(jpg|gif|png|svg|)$/,
use: {
loader: 'url-loader',
options: {
limit: 1000000,
fallback: 'file-loader',
},
},
});
// Inline fonts
config.module.rules.push({
test: /\.(ttf|eot|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 750000, // 1mo
},
},
});
return config;
},
};
module.exports = withTM(nextConfig);