umi-plugin-gh-pages
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

umi-plugin-gh-pages

NPM version NPM downloads

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 build

or

$GH_PAGES_USE_CDN=true umi build

Deploy 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.

image

GH_TOKEN=[tokens]( 
https://github.com/settings/tokens)
GH_PAGES_USE_CDN=true

run the command

$ umi build

Examples

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i umi-plugin-gh-pages

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

13.1 kB

Total Files

5

Last publish

Collaborators

  • sorrycc