-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
36 lines (28 loc) · 1014 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
36
/**
* Adapting this from:
* https://www.viget.com/articles/host-build-and-deploy-next-js-projects-on-github-pages/
*
* We need to ensure that our static assets understand they're being
* served from a folder when we're hosting on github, this however
* is not the case when we host on PROD, so we're going to have to
* check for that.
*/
const _IN_GH_ACTIONS = process.env.NEXT_PUBLIC_IN_GITHUB_ACTIONS || false;
console.log('GITHUB ACTION DETECTED?: ', _IN_GH_ACTIONS);
const _REPO = 'assets2024';
/** @type {import('next').NextConfig} */
const nextConfig = {
/*
Needed for static builds on gh-pages and the eventual public server.
*/
assetPrefix: _IN_GH_ACTIONS !== false ? `/${_REPO}` : '',
basePath: _IN_GH_ACTIONS !== false ? `/${_REPO}` : '',
output: 'export',
trailingSlash: true,
images: {
loader: 'custom',
loaderFile: './src/app/lib/utils/customImageLoader.js',
}
}
console.log(nextConfig);
module.exports = nextConfig