forked from uyu423/resume-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
31 lines (29 loc) · 810 Bytes
/
next.config.js
File metadata and controls
31 lines (29 loc) · 810 Bytes
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
/* eslint-disable */
const withImages = require('next-images');
const { homepage } = require('./package.json');
const { NODE_ENV } = process.env;
module.exports = withImages({
assetPrefix: (() => {
if (NODE_ENV === 'production' && homepage) {
try {
console.log('> Detected homepage url in package.json');
const { pathname } = new URL(homepage);
if (pathname !== '/') {
console.log(`> Apply \'${pathname}\' to assetPrefix(subPath)`);
return pathname;
}
return '';
} catch {
console.log('> Can not parse homepage URL not apply assetPrefix(subPath)');
return '';
}
}
return '';
})(),
});
// withCSS({
// webpack: config => {
// config.resolve.alias['@'] = __dirname;
// return config;
// }
// }),