Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

这里是本地离线预览 React Native 文档的方法,解决因官网 CDN 资源导致无法打开官方文档网站。

NotificationsYou must be signed in to change notification settings

jaywcjlove/react-native-doc

Repository files navigation

Build and Deploy react-native-docDocker Image Version (latest by date)Docker Stars

这里是本地离线预览React Native 官方文档的方法,解决因官网 CDN 资源导致无法打开官方文档网站,已经将处理好的 HTML 存放在gh-pages 分支,只需克隆配合sgo 工具预览即可。

Docker 部署

Port:60005 -react-native-doc@jaywcjlove/docs/react-native

docker pull wcjiang/react-native:latest

Run Server

docker run --name react-native -p 60005:60005 --restart=always -d wcjiang/react-native:latest

下载工程

# 克隆并下载带有 submodule 的项目git clone https://github.com/jaywcjlove/react-native-doc.git --depth=1 --recurse-submodules

参数--recurse-submodules 会克隆太久react-native

# 克隆项目git clone https://github.com/jaywcjlove/react-native-doc.git --depth=1# 初始化 submodule 子项目git submodule update --depth 1 --init --recursive# 更新 submodule 子项目git submodule update --recursive --remote

参数--depth 只有git@2.23.0-rc2 支持

安装依赖

npm install

替换 CDN 资源

通过下面命令批量替换 CDN 资源,运行之前确保react-native 目录下载完成,使用编辑器替换,内容太多会让编辑器卡死。替换内容在这里script/data.js

npm run start

更新 React Native 主文档仓库

# 进入 React Native 仓库cd react-native/# 放弃本地修改内容git reset --hardcd ../# 更新 submodule 子项目git submodule update --recursive --remote

启动服务

npm run server

注意

虽然本地预览静态服务,但仍有很多链接是走CDN,通过运行脚本来替换

Links

About

这里是本地离线预览 React Native 文档的方法,解决因官网 CDN 资源导致无法打开官方文档网站。

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Contributors2

    •  
    •  

    [8]ページ先頭

    ©2009-2025 Movatter.jp