Skip to content

lwp2333/vite-plugin-publish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-publish

Use ftp & oss to publish resources

Install (yarn or npm)

node version: >=12.0.0

vite version: >=2.9.0

yarn add vite-plugin-publish -D

or

npm i vite-plugin-publish -D

Usage

  • Configuration plugin in vite.config.ts
import vitePublish from 'vite-plugin-publish'

export default () => {
  return {
    plugins: [
      vitePublish({
        enable: true,
        ftp: {
          host: 'xxxxx',
          port: 21,
          websiteDir: 'm.lwp.fun',
          username: 'xxxx',
          password: 'xxxxx',
        },
        oss: {
          accessKeyId: 'xxxxx',
          accessKeySecret: 'xxxxx',
          region: 'xxxx',
          bucket: 'xxx',
        },
      }),
    ],
  }
}
  • Configuration plugin in env file
params type Env config filed
enable boolean VITE_PUBLISH_enable
ftp.host number VITE_PUBLISH_FTP_host
ftp.port string VITE_PUBLISH_FTP_port
ftp.websiteDir string VITE_PUBLISH_FTP_websiteDir
ftp.user string VITE_PUBLISH_FTP_user
ftp.password string VITE_PUBLISH_FTP_password
oss.accessKeyId string VITE_PUBLISH_OSS_accessKeyId
oss.accessKeySecret string VITE_PUBLISH_OSS_accessKeySecret
oss.region string VITE_PUBLISH_OSS_region
oss.bucket string VITE_PUBLISH_OSS_bucket

yarn build

About

help the front end publish quickly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published