-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
35 lines (32 loc) · 919 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
// ./next.config.js
require("dotenv").config();
const withPlugins = require("next-compose-plugins");
const withSass = require("@zeit/next-sass");
const path = require("path");
const Dotenv = require("dotenv-webpack");
const nextConfig = {
webpack: (config, { dev }) => {
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: "url-loader",
options: {
limit: 1000000,
compact: true
}
}
});
config.plugins = config.plugins || [];
config.plugins = [
...config.plugins,
new Dotenv({ // Read the .env file
path: path.join(__dirname, ".env"),
systemvars: true
})
];
return config;
}
}
module.exports = withPlugins([
withSass
], nextConfig)