Skip to content

ifanrx/grunt-upyun-push

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-upyun-push Build Status npm version

最简单的 push 文件到又拍云 grunt 插件

说明

源自:https://github.com/gockxml/grunt-upyun/ (1 年未更新了)

如果没有用过 grunt 请看 http://gruntjs.com/

安装

npm install grunt-upyun-push --save-dev

在 Gruntfile.js 中加上

grunt.loadNpmTasks('grunt-upyun-push');

配置

配置选项

options.files

Grunt 经典文件列表配置

Type: Array Default value: []

options.files.expand

请参考 Grunt building-the-files-object

options.files.dest

Push 到 cdn 的目标目录

Type: Array Default value: []

options.files.cwd

以哪个目录为要 push 操作的根目录

Type: Array Default value: []

options.files.src

请参考 Grunt configuring-tasks#files

options.files.filter

请参考 Grunt custom-filter-function

配置 demo

静态资源如下: /local/wait-to-push/dist/app.js /local/wait-to-push/dist/webapp.css

配置如:

grunt.initConfig({
  upyun: {
    th_static: {
      files: [{
        expand: true,
        dest :'/tests/build/static/dist/',
        cwd: './tests/local/wait-to-push/dist/',
        src: ['**/*.js', '**/*.css'],
        filter: 'isFile'
      }]
    },
    images: {
      files: [{
        expand: true,
        dest :'/tests/cdn/url/images/',
        cwd: './tests/local/wait-to-push/images/',
        src: ['**/*.png', '**/*.jpg', '**/*.gif']
      }]
    }
  }
})

push 结果如下: http://your-upyun-domain.com/build/static/dist/app.js http://your-upyun-domain.com/build/static/dist/webapp.css http://your-upyun-domain.com/cdn/url/images/1.jpg http://your-upyun-domain.com/cdn/url/images/2.png

Release History

  • 2015-02-11 v0.1.1 补充 readme
  • 2014-10-11 v0.1.0 Initial commit

About

最简单的 push 文件到又拍云 grunt 插件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%