github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/public/libs/qiniu-js-sdk-master/Gruntfile.coffee (about)

     1  module.exports = (grunt) ->
     2      JS_PATH = 'src/'
     3      JS_FILE = JS_PATH+'qiniu.js'
     4  
     5      grunt.initConfig
     6          jshint:
     7              options:
     8                  jshintrc: '.jshintrc'
     9              all: [JS_FILE]
    10  
    11          uglify:
    12              compress:
    13                  options:
    14                      report: 'min'
    15                  files:
    16                      'src/qiniu.min.js' : [JS_FILE]
    17          copy:
    18              main:
    19                  expand: true
    20                  flatten: true
    21                  src: 'src/qiniu.js'
    22                  dest: 'demo/js/'
    23          watch:
    24              options:
    25                 livereload: true
    26                 debounceDelay: 600
    27              js:
    28                 files: JS_FILE
    29                 tasks: 'jshint'
    30                 options:
    31                     spawn:false
    32              copy:
    33                 files: [JS_FILE]
    34                 tasks: 'copy'
    35              uglify:
    36                  options:
    37                      report: 'min'
    38                  files: [JS_FILE]
    39                  tasks: 'uglify'
    40  
    41      grunt.loadNpmTasks 'grunt-contrib-watch'
    42      grunt.loadNpmTasks 'grunt-contrib-uglify'
    43      grunt.loadNpmTasks 'grunt-contrib-jshint'
    44      grunt.loadNpmTasks 'grunt-contrib-copy'
    45  
    46      grunt.event.on 'watch', (action, filepath) ->
    47          grunt.config ['jshint', 'all'], filepath
    48  
    49      grunt.registerTask 'production', [
    50          'jshint'
    51          'copy'
    52          'uglify:compress'
    53      ]
    54  
    55      grunt.registerTask 'default', [
    56          'jshint'
    57          'copy'
    58          'uglify:compress'
    59      ]