-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
65 lines (63 loc) · 1.69 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
54
55
56
57
58
59
60
61
62
63
64
65
/** @type {import('next').NextConfig} */
const toPath = require("./toPath");
const withImages = require("next-images");
const withPlugins = require("next-compose-plugins");
module.exports = withPlugins(
[
// Consume image files (listed in fileExtensions) using next-images package
[
withImages,
{
fileExtensions: [
"jpg",
"jpeg",
"png",
"gif",
"ico",
"webp",
"jp2",
"avif",
],
},
],
],
{
sassOptions: {
// include the path to the scss folder for easy access (it allows you to do things like
// "@import 'utils'" without having to specify the path)
includePaths: [toPath("./assets/scss")],
// Prepend the following line to every scss file (no need to import to use sass
// variables and other utils in every file)
// prependData: `@use 'utils' as *;`,
prependData: `@use 'utils' as *;`,
},
images: {
disableStaticImages: true,
},
experimental: {
outputStandalone: true,
},
webpack: (config, options) => {
// Consume SVG files for webpack
config.module.rules.push({
test: /\.svg$/,
issuer: /\.[jt]sx?$/,
use: [
{
loader: "@svgr/webpack",
options: {
svgoConfig: {
plugins: [{ removeViewBox: false }], // this is needed since webpack removes viewbox by default, rendering our styles for svg obsolete
},
},
},
],
});
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
});
return config;
},
}
);