-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
39 lines (37 loc) · 1.12 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
const path = require('path');
const debug = process.env.NODE_ENV !== 'production';
module.exports = {
basePath: !debug ? 'https://sammiepls.github.io/' : '',
sassOptions: {
data: '@import "path/to/global.scss";',
includePaths: [path.join(__dirname, 'styles')],
},
exportPathMap: function () {
return {
'/': { page: '/' },
//'/about': { page: '/about' },
};
},
//assetPrefix: '',
assetPrefix: !debug ? 'https://sammiepls.github.io/' : '',
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
}, */,
};