Skip to content

Commit e21bfde

Browse files
committed
feat: 实现最基础的markdown展示
1 parent e6f492e commit e21bfde

File tree

20 files changed

+1800
-3
lines changed

20 files changed

+1800
-3
lines changed

index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.md' {
2+
const content: string;
3+
export default content;
4+
}

next.config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
import NextBundleAnalyzer from '@next/bundle-analyzer';
3+
import withLess from 'next-with-less';
34

45
let nextConfig = {
56
images: {
@@ -15,6 +16,14 @@ let nextConfig = {
1516
},
1617
],
1718
},
19+
webpack(config) {
20+
config.module.rules.push({
21+
test: /\.md$/,
22+
use: 'raw-loader',
23+
});
24+
25+
return config;
26+
},
1827
};
1928

2029
if (process.env.ANALYZE === 'true') {
@@ -23,4 +32,4 @@ if (process.env.ANALYZE === 'true') {
2332
})(nextConfig);
2433
}
2534

26-
export default nextConfig;
35+
export default withLess(nextConfig);

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@
3030
"colorjs.io": "^0.5.2",
3131
"daisyui": "^4.12.13",
3232
"framer-motion": "11.11.1",
33+
"markdown-to-jsx": "npm:@innei/[email protected]",
3334
"next": "14.2.15",
3435
"next-themes": "^0.3.0",
36+
"next-with-less": "^3.0.1",
3537
"pngjs": "^7.0.0",
3638
"postcss-js": "^4.0.1",
3739
"prettier": "3.3.2",
40+
"raw-loader": "^4.0.2",
3841
"react": "^18",
3942
"react-dom": "^18",
43+
"sass": "^1.80.6",
4044
"tailwind-merge": "^2.5.4",
4145
"tailwind-scrollbar": "^3.1.0",
4246
"tailwind-variants": "^0.2.1",

0 commit comments

Comments
 (0)