-
Notifications
You must be signed in to change notification settings - Fork 17
/
next.config.js
53 lines (44 loc) · 1.17 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
require("dotenv").config();
const path = require("path");
const withImages = require("next-images");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const configureWebpack = (config, { dev }) => {
config.plugins = config.plugins || [];
if (config.resolve.plugins) {
config.resolve.plugins.push(new TsconfigPathsPlugin());
} else {
config.resolve.plugins = [new TsconfigPathsPlugin()];
}
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: "url-loader",
options: {
limit: 100000,
name: "[name].[ext]",
},
},
});
config.module.rules.push({
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: "graphql-tag/loader",
});
if (dev) {
config.module.rules.push({
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "eslint-loader",
});
config.devtool = "cheap-module-eval-source-map";
}
return config;
};
module.exports = withImages({
webpack: {
...configureWebpack,
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
},
}
});