umi plugin to publish to Github Pages. Support useJsdelivr.
npm install umi-plugin-gh-pages

umi plugin to publish to Github Pages.
Configure in .umirc.js,
``js`
export default {
ghPages:{
dir:'dist',
useCDN: false,
getCDNUrl:(gitInfo)=>{return 'url'}
...gh-pages#PublishOptions
}
}
(default umi config outputPath), other options please checkout https://github.com/tschaub/gh-pages#options$3
use CDN in publicPath ,default use jsdelivr - A free CDN for Open Source.
$3
Custom CDN url.
$3
config/config.ts
`ts
{
ghPages: {
useCDN: true,
},
}
``bash
umi build
`or
`bash
$GH_PAGES_USE_CDN=true umi build
`$3
config/config.ts
`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
GH_PAGES_USE_CDN=true
`run the command
`bash
$ umi build
``* https://github.com/sorrycc/test-gh-pages
* https://sorrycc.github.io/test-gh-pages/
* https://github.com/alitajs/alita-docs
MIT