-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
43 lines (40 loc) · 1.06 KB
/
next.config.js
File metadata and controls
43 lines (40 loc) · 1.06 KB
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 withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.jsx'
})
// Set correct basePath for GitHub Pages
const isDev = process.env.NODE_ENV !== 'production'
const basePath = isDev ? '' : '/docs'
module.exports = withNextra({
output: 'export',
images: {
unoptimized: true,
},
basePath,
assetPrefix: basePath,
trailingSlash: true,
transpilePackages: [
'@copilotkit/react-core',
'@copilotkit/react-ui',
'@copilotkitnext/react',
],
webpack: (config) => {
// Allow importing global CSS from node_modules (needed by CopilotKit/KaTeX)
const cssRules = config.module.rules.find(
(rule) => typeof rule.oneOf === 'object'
);
if (cssRules) {
cssRules.oneOf.forEach((rule) => {
if (
rule.sideEffects === false &&
rule.test &&
rule.test.toString().includes('css')
) {
delete rule.sideEffects;
}
});
}
return config;
},
})
// If you have other Next.js configurations, you can pass them as the parameter above