Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 优化启动 dev-server 的文档 #5130

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ pnpm install

配置本地调试环境:

**启动开发服务 dev-server**
1. 确保已安装 `ts-node`,如未安装,可通过 `npm install -g ts-node` 安装
2. 进入项目根目录
3. 运行 `ts-node dev-tools/dev-server/index.ts` 启动开发服务,没问题的话可以看到类似的输出:

```bash
$ ts-node dev-tools/dev-server/index.ts
DevServer 已启动, 端口: 23333
本体编译中...
(...可能有一长串输出)

本体已编译: (一段 hash)
```


**如果使用的是基于 Chromium 的浏览器**
1. VS Code 中运行 `启动开发服务 dev-server` 任务, 会在项目的 `dist/` 文件夹下生成一个开发用的脚本 `dist/bilibili-evolved.dev.user.js`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里针对 VSCode 其实已经写了启动方法了,使用 VSCode 时直接用任务启动会更方便,命令行启动应该注明一下,比如「在不使用 VSCode 时也可直接使用命令行启动开发服务」。
ts-node 的安装可以移动到上面的「搭建开发环境」段落中。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实也不需要另外再装 ts-node, 我会根据这个 PR 的内容调整一下, 提供 VSCode 和命令行启动的两种方式说明

2. Chrome 插件管理 `chrome://extensions/` > Tampermonkey > 详细信息
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/dev-server/watcher-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const defaultWatcherHandler = (
assets: false,
modules: false,
chunks: false,
color: true,
colors: true,
}),
)
}
Expand Down