Skip to content

Commit

Permalink
项目迁移至rsbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
buyfakett committed Feb 18, 2025
1 parent 237823e commit 7f6d11e
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 12 deletions.
6 changes: 4 additions & 2 deletions src/CHANGELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2025-02-18 项目迁移至`rsbuild`

2025-01-25 增加更多项目界面

2025-01-24 增加咖啡界面
Expand All @@ -16,9 +18,9 @@

2025-01-10 重构获取数据从py改为js

2025-01-06 封装BackTop组件,使得有进度条
2025-01-06 封装`BackTop`组件,使得有进度条

2025-01-06 增加prettier来格式化代码
2025-01-06 增加`prettier`来格式化代码

2024-12-24 增加提交数等显示

Expand Down
2 changes: 1 addition & 1 deletion public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="about me • buyfakett">
<meta name="time-zone" content="Asia/Shanghai">
<title>About Me</title>
</head>
<script type="module" src="src/index"></script></head>
<body>
<div id="root"></div>
</body>
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
"react-markdown": "^9.0.3",
"react-router-dom": "^7.0.2",
"tailwind-merge": "^2.5.5",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7"
},
"scripts": {
"start": "react-scripts start",
"start": "rsbuild dev",
"dev": "rsbuild dev",
"prebuild": "node src/scripts/fetchWakatimeData.js",
"getgitinfo": "node src/scripts/generateBuildInfo.js",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"build": "rsbuild build"
},
"browserslist": {
"production": [
Expand Down Expand Up @@ -62,12 +60,17 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@rsbuild/core": "^1.2.8",
"@rsbuild/plugin-mdx": "^1.0.2",
"@rsbuild/plugin-react": "^1.1.0",
"@tailwindcss/postcss": "^4.0.6",
"@types/node": "^22.13.4",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"prettier": "3.4.2",
"raw-loader": "^4.0.2",
"react-scripts": "^5.0.1",
"react-snap": "^1.23.0",
"tailwindcss": "^3.4.17",
"typescript": "^4.9.5"
}
}
5 changes: 5 additions & 0 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
},
};
25 changes: 25 additions & 0 deletions rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginMdx } from "@rsbuild/plugin-mdx";

export default defineConfig({
plugins: [
pluginReact(),
pluginMdx(),
],
html: {
template: './index.html',
},
source: {
entry: {
index: './src/index.jsx',
},
// 编译所有 JS 文件并排除 core-js
include: [{ not: /[\\/]core-js[\\/]/ }],
},
output: {
distPath: {
root: 'build',
},
},
});
2 changes: 1 addition & 1 deletion src/index.js → src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ root.render(
<App />
</ThemeProvider>
</BrowserRouter>
</React.StrictMode>,
</React.StrictMode>
);
4 changes: 2 additions & 2 deletions src/util/ChangeLog.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Markdown from 'react-markdown';
import md from '!!raw-loader!../CHANGELOG.md';
import changelog from '../../CHANGELOG.md';
import { pageVariants } from '../config.js';
import { Button } from '@douyinfe/semi-ui';
import { motion } from 'framer-motion';
Expand All @@ -26,7 +26,7 @@ const ChangeLog = () => {
返回首页
</Button>
</div>
<Markdown className="mt-10 text-xl leading-loose">{md}</Markdown>
<Markdown className="mt-10 text-xl leading-loose">{changelog}</Markdown> {/* 这里渲染Markdown */}
</motion.div>
);
};
Expand Down

0 comments on commit 7f6d11e

Please sign in to comment.