Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Gruntfile.js « jquery.browser « node_modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4d3c2fb7afd0880c0eba5ae8e7d86c1c5b9ff646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    browserify: {
      'test/test-require.js': ['test/src/require/test.js'],
      options: {
        banner: '/*\n\n ****** Testing Require file ****** \n\n*/'
      }
    },
    jshint: {
      files: ['Gruntfile.js', 'dist/jquery.browser.js', 'test/test.js'],

      options: {
        globals: {
          jQuery: true,
          console: true,
          module: true
        }
      }
    },
    uglify: {
      options: {
        banner: '/*!\n * jQuery Browser Plugin <%= pkg.version %>\n * https://github.com/gabceb/jquery-browser-plugin\n *\n * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors\n * http://jquery.org/license\n *\n * Modifications Copyright <%= grunt.template.today("yyyy") %> Gabriel Cebrian\n * https://github.com/gabceb\n *\n * Released under the MIT license\n *\n * Date: <%= grunt.template.today("dd-mm-yyyy")%>\n */'
      },
      dist: {
        files: {
          'dist/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.js'
        }
      }
    },
    copy: {
      main: {
        src: "dist/<%= pkg.name %>.js",
        dest: "test/src/<%= pkg.name %>.js"
      }
    },
    exec: {
      'test-jquery': {
        command: "casperjs test test/test.js",
        stdout: true,
        stderr: true
      },
      'test-require': {
        command: "./node_modules/.bin/mocha test/test-require.js",
        stdout: true,
        stderr: true
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-exec');
  grunt.loadNpmTasks('grunt-browserify');

  grunt.registerTask('default', ['jshint', 'uglify', 'copy']);

  grunt.registerTask('test-jquery', ['default', 'exec:test-jquery']);
  grunt.registerTask('test-require', ['default', 'browserify', 'exec:test-require']);
  grunt.registerTask('test', ['test-jquery', 'test-require']);
};