1.2.1 • Published 2 years ago

vite-plugin-publish v1.2.1

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

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
paramstypeEnv config filed
enablebooleanVITE_PUBLISH_enable
ftp.hostnumberVITE_PUBLISH_FTP_host
ftp.portstringVITE_PUBLISH_FTP_port
ftp.websiteDirstringVITE_PUBLISH_FTP_websiteDir
ftp.userstringVITE_PUBLISH_FTP_user
ftp.passwordstringVITE_PUBLISH_FTP_password
oss.accessKeyIdstringVITE_PUBLISH_OSS_accessKeyId
oss.accessKeySecretstringVITE_PUBLISH_OSS_accessKeySecret
oss.regionstringVITE_PUBLISH_OSS_region
oss.bucketstringVITE_PUBLISH_OSS_bucket

yarn build

npm.io