-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
60 lines (53 loc) · 1.45 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
60
// @ts-check
const { patchWebpackConfig } = require('next-global-css');
/**
* @type {import('next').NextConfig}
**/
module.exports = {
env: {
APPLICATION_ID: process.env.APPLICATION_ID,
APPLICATION_SECRET: process.env.APPLICATION_SECRET,
APPLICATION_CALLBACK: process.env.APPLICATION_CALLBACK,
APPLICATION_API_CALLBACK: process.env.APPLICATION_API_CALLBACK,
APPLICATION_API_PATH: process.env.APPLICATION_API_PATH,
SERVER_AUTH_CALLBACK: process.env.SERVER_AUTH_CALLBACK,
GRAPHQL_TOKEN: process.env.GRAPHQL_TOKEN,
AUTHENTICATION_ENABLED:
process.env.NODE_ENV === 'production' ? false : true,
},
typescript: {
ignoreBuildErrors: true,
},
webpack(config, options) {
patchWebpackConfig(config, options);
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: [
{
loader: '@svgr/webpack',
options: {
titleProp: true,
// dimensions: false,
svgo: false,
},
},
],
});
config.module.rules.push({
test: /\.(ts)x?$/, // Just `tsx?` file only
use: [
// options.defaultLoaders.babel, I don't think it's necessary to have this loader too
{
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
onlyCompileBundledFiles: true,
},
},
],
});
return config;
},
};