-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathnext.config.js
62 lines (61 loc) · 1.67 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
const path = require('path');
const { locales } = require('./lib/intl/config.json');
module.exports = {
reactStrictMode: true,
// TODO: Re-enable ESLint failing builds once I've fixed all the errors.
eslint: { ignoreDuringBuilds: true },
sassOptions: {
includePaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'src/*/node_modules'),
],
},
images: {
domains: ['assets.tutorbook.org', 'firebasestorage.googleapis.com'],
imageSizes: [642, 350, 200, 160, 120, 85, 48, 40, 24],
},
async redirects() {
return [
{
source: '/signup',
destination: '/default/signup',
permanent: true,
},
{
source: '/:org/search/:id',
destination: '/:org/users/:id',
permanent: true,
},
{
source: '/:org/people/:slug*',
destination: '/:org/users/:slug*',
permanent: true,
},
{
source: '/dashboard',
destination: '/overview',
permanent: true,
},
{
source: '/:org/dashboard',
destination: '/:org/overview',
permanent: true,
},
];
},
webpack(config, { isServer, defaultLoaders }) {
if (!isServer && process.env.ANALYZE === 'true') {
// Only run the bundle analyzer for the client-side chunks.
// @see {@link https://github.com/vercel/next.js/issues/15481}
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: './analyze/client.html',
generateStatsFile: true,
})
);
}
return config;
},
};