-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
43 lines (33 loc) · 1015 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
37
38
39
40
41
42
43
const UnoCSS = require("@unocss/webpack").default;
// const presetUno = require("@unocss/preset-uno").default;
const isGithubActions = process.env.GITHUB_ACTIONS || false;
let assetPrefix = "/";
let basePath = "";
if (isGithubActions || process.env.NODE_ENV != "development") {
// trim off `<owner>/`
// const repo = process.env.GITHUB_REPOSITORY.replace(/.*?\//, "");
assetPrefix = `./`;
// basePath = `/${repo}`;
basePath = ``;
}
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
assetPrefix: assetPrefix,
basePath: basePath,
// reactStrictMode: true,
webpack: (config, context) => {
config.plugins.push(UnoCSS());
// config.optimization = {
// realContentHash: true,
// }
// if (context.buildId !== "development") {
// // * disable filesystem cache for build
// // * https://github.com/unocss/unocss/issues/419
// // * https://webpack.js.org/configuration/cache/
// }
return config;
},
};
module.exports = nextConfig;