-
Notifications
You must be signed in to change notification settings - Fork 6
/
next.config.js
46 lines (41 loc) · 1023 Bytes
/
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 path = require("path");
const webpack = require("webpack");
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders }) => {
// Perform customizations to webpack config
// Important: return the modified config
config.resolve.alias["@commerce-ui/core"] = path.resolve(
__dirname,
"src/packages/"
);
config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: {
removeViewBox: false
}
},
titleProp: true
}
}
]
});
config.plugins.push(
new webpack.DefinePlugin({
__DEV__: true,
__BROWSER__: !isServer
})
);
return config;
},
webpackDevMiddleware: config => {
// Perform customizations to webpack dev middleware config
// Important: return the modified config
return config;
},
target: "serverless"
};