-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnext.config.js
43 lines (38 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
40
41
42
43
const { default: next } = require('next');
const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)$/,
})
const isGitHub = process.env.GITHUB_ACTIONS === "true";
console.log(`Running in ${isGitHub ? "GitHub Actions" : "local"} mode`);
process.env.NEXT_PUBLIC_GITHUB_ACTIONS = process.env.GITHUB_ACTIONS || false;
process.env.NEXT_PUBLIC_GITHUBSECRET = process.env.GITHUBSECRET || false;
process.env.NEXT_PUBLIC_ASSET_PREFIX = process.env.PAGES_PATH || '';
const nextConfig = {
output: "export",
images: {
unoptimized: true,
},
// Add CSS optimization
experimental: {
optimizeCss: true, // Enable CSS optimization
},
webpack(config) {
// CSS handling
config.module.rules.push({
test: /\.css$/,
use: ['style-loader', 'css-loader']
});
// SCSS handling
config.module.rules.push({
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
});
return config;
}
}
console.log(nextConfig);
module.exports = nextConfig;