Skip to content

umi3.x插件,build结束后自动上传构建结果至远程服务器

Notifications You must be signed in to change notification settings

xusanduo08/umi-plugin-upload-new

Repository files navigation

umi-plugin-upload-new

NPM version NPM downloads

适用于umi3.x,umi2.x请使用umi-plugin-upload

Install

# or yarn
$ npm install
$ npm run build --watch
$ npm run start

Usage

Configure in .umirc.js,

export default {
  plugins: [
    ['umi-plugin-upload-new'],
  ],
  upload: {
    host: 'xxx',
    username: 'xxx',
    password: 'xxxx',
    sourcePath: 'dist/',
    targetPath: '/home/test'
  }
}

如果没有配置密码,则在上传时命令行会给出交互提示输入密码

Example

Upload directory

export default {
  plugins: [
    ['umi-plugin-upload']
  ],
  upload: {
    host: 'xxxx',
    username: 'xxxx',
    password: 'xxxx',
    sourcePath: 'dist/',
    targetPath: '/home/ubuntu/test'
  }
}
// 将dist目录上传到/home/ubuntu下,并命名为test

Upload file

export default {
  plugins: [
    ['umi-plugin-upload']
  ],
  upload: {
    host: 'xxxx',
    username: 'xxxx',
    password: 'xxxx',
    sourcePath: 'dist/umi.js',
    targetPath: '/home/ubuntu/test.js'
  }
}
// 将umi.js上传到/home/ubuntu下并重命名为test.js

Glob pattern

export default {
  plugins: [
    ['umi-plugin-upload']
  ],
  upload: {
    host: 'xxxx',
    username: 'xxxx',
    password: 'xxxx',
    sourcePath: 'dist/*.js',
    targetPath: '/home/ubuntu/test'
  }
}
// 将dist下的所有js文件上传到/home/ubuntu/test目录下,glob模式请确保targetPath代表的目录在远程是存在的

Options

TODO

LICENSE

MIT

About

umi3.x插件,build结束后自动上传构建结果至远程服务器

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published