forked from theirc/signpost-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
98 lines (96 loc) · 3.1 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const withLess = require('next-with-less');
const pack = require('./package.json');
const withPWA = require('next-pwa')({ dest: 'public' });
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: false,
// Keep in sync with locales configured in /lib/locale.ts.
i18n: {
locales: ['default', 'es'],
defaultLocale: 'default',
localeDetection: false,
},
async redirects() {
return [
// Redirect legacy Zendesk paths with slugs. For example, redirect
// /articles/123456-Article-Title to /articles/123456.
{
source: '/:resource/:id(\\d{1,}):rest(-.*)',
destination: '/:resource/:id',
permanent: true,
},
];
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'signpost-mexico.zendesk.com',
},
{
protocol: 'https',
hostname: 'directus-irc.azurewebsites.net',
},
],
},
publicRuntimeConfig: {
version: pack.dependencies['@ircsignpost/signpost-base'],
},
webpack: (config) => {
config.snapshot = {
...(config.snapshot ?? {}),
// Add all node_modules but @next module to managedPaths
// Allows for hot refresh of changes to @next module
managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@next)/],
};
return config;
},
};
module.exports = withPWA(
withLess({
...nextConfig,
lessLoaderOptions: {
lessOptions: {
// See full list of Ant styles here:
// https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
modifyVars: {
'primary-color': '#4D5DE2',
'secondary-color': '#364BF6',
'accent-color': '#FFB500',
'info-color': '@accent-color',
'alert-info-bg-color': '@accent-color',
// Override Ant typography.
'heading-1-size': '3.75rem',
'heading-2-size': '1.875rem',
'typography-title-font-weight': '400',
// Set height and border radius for 'default' type elements, e.g. buttons, inputs, etc.
'height-base': '48px',
'height-sm': '32px',
'border-radius-base': '10px',
'border-color-base': '#141414',
// Set header styles.
'layout-header-height': 'auto',
'layout-header-min-height': '4.375rem',
'layout-header-padding': '0',
'header-background-color': '@primary-color',
'header-text-color': 'white',
'header-banner-background-color':
'linear-gradient(173.7deg, @primary-color -6.17%, @secondary-color 98.88%);',
'header-banner-text-color': 'white',
// Set search styles.
'search-icon-color': 'white',
'search-icon-bg-color': '@accent-color',
// Set card styles.
'card-padding-base': '16px',
'home-page-card-icon-color': '#141414',
// Set cookie banner styles.
'cookie-banner-text': '#000',
'cookie-banner-back': '@accent-color',
'link-color': '#0000ee',
'link-hover-color': '#0000eea8',
},
},
},
})
);