docs: update README to recommend git clone instead of npm install

This commit is contained in:
陈海富
2026-01-31 20:37:30 +08:00
parent 45280c072a
commit c57885fdc9
4 changed files with 15 additions and 28 deletions

View File

@@ -20,24 +20,14 @@
### 智能浏览器Electron 桌面应用)
```bash
# 方式一:官方加速源安装(推荐,东京服务器
npm install -g cfspider-browser --registry=https://npm.cfspider.com
cfspider-browser
# 方式二npx 直接运行
npx cfspider-browser --registry=https://npm.cfspider.com
# 方式三npmjs.org 安装
npm install -g cfspider-browser
cfspider-browser
# 方式四:克隆仓库
# 克隆仓库(推荐
git clone https://github.com/violettoolssite/CFspider.git
cd CFspider/cfspider-browser
npm install && npm run electron:dev
npm install
npm run electron:dev
```
> **加速提示**配置全局使用官方镜像:`npm config set registry https://npm.cfspider.com`
> **加速提示**使用官方 npm 镜像加速下载:`npm install --registry=https://npm.cfspider.com`
### Python 代理库

View File

@@ -19,10 +19,6 @@ const command = args[0] || 'dev';
// 获取包的根目录
const packageRoot = path.resolve(__dirname, '..');
// 调试信息
console.log('[DEBUG] __dirname:', __dirname);
console.log('[DEBUG] packageRoot:', packageRoot);
// 检查是否在正确的目录
const packageJsonPath = path.join(packageRoot, 'package.json');
if (!fs.existsSync(packageJsonPath)) {
@@ -30,14 +26,6 @@ if (!fs.existsSync(packageJsonPath)) {
process.exit(1);
}
// 读取并显示版本
try {
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
console.log('[DEBUG] package.json version:', pkg.version);
} catch (e) {
console.error('[DEBUG] Failed to read package.json:', e.message);
}
// 检查依赖是否已安装
const nodeModulesPath = path.join(packageRoot, 'node_modules');
const esbuildPath = path.join(nodeModulesPath, '.bin', process.platform === 'win32' ? 'esbuild.cmd' : 'esbuild');

View File

@@ -64,7 +64,7 @@
"lucide-react": "^0.294.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "9.0.1",
"react-markdown": "^10.1.0",
"react-syntax-highlighter": "^16.1.0",
"xlsx": "^0.18.5",
"zustand": "^5.0.0"

View File

@@ -11,7 +11,16 @@ export default defineConfig({
}
},
optimizeDeps: {
include: ['zustand', 'react', 'style-to-js', 'html-react-parser']
include: [
'zustand',
'react',
'react-dom',
'react-markdown',
'react-syntax-highlighter',
'html-react-parser',
'style-to-js',
'debug'
]
},
build: {
outDir: 'dist',