1.1.6 • Published 5 years ago
umi-plugin-gh-pages-test v1.1.6
umi-plugin-gh-pages
umi plugin to publish to Github Pages.
Usage
Configure in .umirc.js,
export default {
ghPages:{
dir:'dist',
useCDN: false,
getCDNUrl:(gitInfo)=>{return 'url'}
...gh-pages#PublishOptions
}
}ghPages
dir
exclude dir (default umi config outputPath), other options please checkout https://github.com/tschaub/gh-pages#options
useCDN
use CDN in publicPath ,default use jsdelivr - A free CDN for Open Source.
getCDNUrl
Custom CDN url.
Deploy in GitHub pages
config/config.ts
{
ghPages: {
useCDN: true,
},
}umi buildor
$GH_PAGES_USE_CDN=true umi buildDeploy in vercel (now)
config/config.ts
{
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=truerun the command
$ umi buildExamples
- https://github.com/sorrycc/test-gh-pages
- https://sorrycc.github.io/test-gh-pages/
- https://github.com/alitajs/alita-docs
LICENSE
MIT