Update README.md
umi plugin to publish to Github Pages.
Configure in .umirc.js,
.umirc.js
export default { ghPages:{ dir:'dist', useCDN: false, getCDNUrl:(gitInfo)=>{return 'url'} ...gh-pages#PublishOptions } }
exclude dir (default umi config outputPath), other options please checkout https://github.com/tschaub/gh-pages#options
dir
outputPath
use CDN in publicPath ,default use jsdelivr - A free CDN for Open Source.
Custom CDN url.
config/config.ts
{ ghPages: { useCDN: true, }, }
umi build
or
$GH_PAGES_USE_CDN=true umi build
{ ghPages: { branch: 'gh-pages', silent: true, repo: `https://${process.env.GH_TOKEN}@github.com/alitajs/alita-docs.git`, }, }
set the environment variables in vercel, with Production.
GH_TOKEN=[tokens]( https://github.com/settings/tokens) GH_PAGES_USE_CDN=true
run the command
$ umi build
MIT
如何优雅的使用 CDN 优化博客
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
umi-plugin-gh-pages
umi plugin to publish to Github Pages.
Usage
Configure in
.umirc.js,ghPages
dir
exclude
dir(default umi configoutputPath), other options please checkout https://github.com/tschaub/gh-pages#optionsuseCDN
use CDN in publicPath ,default use jsdelivr - A free CDN for Open Source.
getCDNUrl
Custom CDN url.
Deploy in GitHub pages
config/config.ts
or
Deploy in vercel (now)
config/config.ts
set the environment variables in vercel, with Production.
run the command
Examples
LICENSE
MIT
Other
如何优雅的使用 CDN 优化博客