GithubHelp home page GithubHelp logo

grunt-assets-deployer's Introduction

grunt-assets-deployer Build Status NPM version

Photo

About

因为个人Ghost博客( http://track-novtopro.rhcloud.com/ )是在OpenShift上,由于总所周知的原因,访问比较慢,所以想把一些静态资源放在七牛云存储。开始的时候我想使用 grunt-qiniu-deploy( https://github.com/chenboxiang/grunt-qiniu-deploy ),但是作者有一段时间没有更新,并且不支持同名文件的更新操作, 所以自己基于他的代码写了这么个Grunt plugin,在此对他表示感谢。

Usage

'use strict';

var config = require('./test/config');

module.exports = function (grunt) {

  grunt.initConfig({
    qiniu: {
      options: {
        ACCESS_KEY: config.ACCESS_KEY,
        SECRET_KEY: config.SECRET_KEY,
        bucket_name: config.bucket_name,
        domain: config.domain
      },

      resources: [
        {
          cwd: 'test/fixtures',
          // 上传到七牛后加上指定前缀, 如上传assets/css/main.css, 上传之后的URL变成 http://bucket_name.qiniudn.com/public/assets/css/main.css
          prefix: 'public/',
          pattern: '**/*.*'
        }
      ]
    }
  });

  grunt.loadTasks('tasks');
  grunt.loadTasks('grunt-assets-deployer');
  
  grunt.registerTask('qiniu');
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.