-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnext.config.js
46 lines (45 loc) · 1.32 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
const nextTranslate = require('next-translate');
module.exports = nextTranslate({
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
serverRuntimeConfig: {
// Will only be available on the server side
scrapedFilesFolder: '.next/tmp/services', // where to store the files retrieved by puppeteer calls
scrapedIframeUrl: '/iframe/services', // url on which the files in the above folder will be accessible
},
publicRuntimeConfig: {
// Will be available on both server and client
author: {
name: 'Anonymous Contributor',
email: '[email protected]',
},
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
// issuer section restricts svg as component only to
// svgs imported from js / ts files.
//
// This allows configuring other behavior for
// svgs imported from other file types (such as .css)
issuer: { and: [/\.(js|ts|md)x?$/] },
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: { plugins: [{ removeViewBox: false }] },
},
},
],
});
return config;
},
async redirects() {
return [
{
source: '/contribute/service/:path*',
destination: '/service/:path*',
permanent: true,
},
];
},
});