1.1.6 • Published 3 years ago

umi-plugin-gh-pages-test v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago