-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
64 lines (59 loc) · 1.41 KB
/
next.config.js
File metadata and controls
64 lines (59 loc) · 1.41 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
const path = require('path');
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
outputStandalone: true
},
webpack: (config, context) => {
config.module.rules.push({
test: /\.svg$/i,
include: path.join(process.cwd(), 'icons'),
use: [
{
loader: 'svg-sprite-loader',
options: {
extract: true,
outputPath: 'static/',
publicPath: 'static/',
esModule: false
}
}
]
});
config.module.rules.push({
test: /\.svg$/i,
include: path.join(process.cwd(), 'public', 'images'),
use: [
{
loader: '@svgr/webpack',
// https://react-svgr.com/docs/options/
options: {
prettier: false,
svgo: true,
titleProp: true,
svgoConfig: {
plugins: [
{
name: 'removeViewBox',
active: false
},
{
name: 'prefixIds',
active: false
}
]
}
}
},
{
loader: 'file-loader'
}
]
});
config.plugins.push(new SpriteLoaderPlugin());
return config;
}
};
module.exports = nextConfig;