-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
35 lines (33 loc) · 1.01 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
// This file is not going through babel transformation.
// So, we write it in vanilla JS
// (But you could use ES2015 features supported by your Node.js version)
const debug = process.env.NODE_ENV !== "production";
module.exports = {
exportPathMap: function() {
return {
"/": { page: "/" }
};
},
//assetPrefix: '',
assetPrefix: !debug ? "/" : "",
webpack: (config, { dev }) => {
// Perform customizations to webpack config
// console.log('webpack');
// console.log(config.module.rules, dev);
config.module.rules = config.module.rules.map(rule => {
if (rule.loader === "babel-loader") {
rule.options.cacheDirectory = false;
}
return rule;
});
// Important: return the modified config
return config;
} /*,
webpackDevMiddleware: (config) => {
// Perform customizations to webpack dev middleware config
// console.log('webpackDevMiddleware');
// console.log(config);
// Important: return the modified config
return config
}, */
};