-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
51 lines (46 loc) · 1.29 KB
/
next.config.js
File metadata and controls
51 lines (46 loc) · 1.29 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
/** @type {import("next").NextConfig} */
module.exports = {
reactStrictMode: true,
trailingSlash: true,
// when building for github pages, set the following
...(process.env.NEXT_PUBLIC_GH_DEPLOY
? {
basePath: "/element-frontend",
assetPrefix: "/element-frontend", // ensures relative paths for assets
}
: {}),
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
webpack(config) {
// https://react-svgr.com/docs/webpack/#use-svgr-and-asset-svg-in-the-same-project
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
oneOf: [
// To import an svg as a url (to be used as an img src), add ?url to
// the end of the import path.
// Example: import sampleImgSrc from "sample.svg?url"
{
resourceQuery: /url/,
type: "asset",
},
{
loader: "@svgr/webpack",
// important to prevent rendering broken SVGs
options: {
svgo: true,
svgoConfig: {
plugins: [{ removeViewBox: false }],
},
},
},
],
});
return config;
},
};