-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
41 lines (34 loc) · 1.15 KB
/
next.config.mjs
File metadata and controls
41 lines (34 loc) · 1.15 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
// next.config.mjs
import remarkGfm from 'remark-gfm';
import createMDX from '@next/mdx';
import { remarkCodeHike } from '@code-hike/mdx';
/** @type {import('next').NextConfig} */
const baseConfig = {
reactStrictMode: true,
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
// GitHub Pages needs a static export
output: 'export',
images: { unoptimized: true },
trailingSlash: true,
// We run ESLint as a dedicated CI step (npm run lint),
// so skip lint during `next build` for faster/cleaner output.
eslint: {
ignoreDuringBuilds: true,
// Optional: limit the dirs that Next would lint if you re-enable it later
dirs: ['app', 'components', 'hooks', 'lib', 'scripts', 'stories'],
},
};
// Only add basePath/assetPrefix on CI so local dev stays clean
const isCI = process.env.GITHUB_ACTIONS === 'true';
const repo = 'shadcn-extras';
const nextConfig = {
...baseConfig,
...(isCI ? { basePath: `/${repo}`, assetPrefix: `/${repo}/` } : {}),
};
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm, [remarkCodeHike, { theme: 'material-darker' }]],
},
});
export default withMDX(nextConfig);