-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
53 lines (47 loc) · 1.24 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
/** @type {import('next').NextConfig} */
const path = require('node:path')
const nextConfig = {
reactStrictMode: true,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Fixes the slds style dependencies
config.module.rules.push(
{
test: /\.jsx?$/,
include: [
'node_modules/@salesforce/design-system-react',
].map(
someDir => path.resolve(
process.cwd(),
someDir
)
),
loader: require.resolve('babel-loader'),
options: {
presets: [
"@babel/preset-env",
"@babel/preset-react",
]
}
});
//
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
},
}
module.exports = nextConfig