-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
67 lines (64 loc) · 1.73 KB
/
next.config.js
File metadata and controls
67 lines (64 loc) · 1.73 KB
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
/** @type {import('next').NextConfig} */
const generateSceneImageRewrites = require('./lib/generateSceneImageRewrites');
const path = require('path');
const nextConfig = {
images: {
// If you need a custom loader, you can uncomment the following line
// loader: 'custom',
//loaderFile: './my/image/loader.js',
//loader: 'custom',
//loaderFile: './app/imageLoaders/contentfulLoader.js',
/*loaders: [
{
name: 'default',
loaderFile: 'https://example.com/mydefaultloader/',
},
{
name: 'custom',
loaderFile: './imageLoaders/contentfulLoader.js',
},
],*/
formats: ['image/avif', 'image/webp'],
//domains: ['images.ctfassets.net', 'scenes-images.soundoffractures.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'images.ctfassets.net',
},
{
protocol: 'https',
hostname: 'scenes-images.soundoffractures.com',
},
{
protocol: 'https',
hostname: 'scenes-preview.soundoffractures.com',
},
{
protocol: 'https',
hostname: 'scenes.soundoffractures.com',
},
],
},
webpack: (config, options) => {
// Here we push your external dependencies to the webpack config
config.externals.push('pino-pretty', 'lokijs', 'encoding');
config.module.rules.push({
test: /\.svg$/,
exclude: [path.resolve(__dirname, 'unused')],
use: [
{
loader: '@svgr/webpack',
options: {
// SVGR options
}
}
]
});
return config;
},
async rewrites() {
const sceneImageRewrites = await generateSceneImageRewrites();
return sceneImageRewrites;
},
};
module.exports = nextConfig;