forked from CardinalPath/gas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
97 lines (93 loc) · 2.56 KB
/
Gruntfile.js
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*global module,require*/
module.exports = function (grunt) {
'use strict';
require('matchdep')
.filterDev('grunt-*')
.forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: [
'/**',
' * @preserve Copyright 2011, Cardinal Path and DigitalInc.',
' *',
' * GAS - Google Analytics on Steroids',
' * https://github.com/CardinalPath/gas',
' *',
' * @author Eduardo Cereto <[email protected]>',
' * Licensed under the GPLv3 license.',
' */',
'',
].join('\n'),
// Task configuration.
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
src: {
src: ['src/**/*.js', '!src/wrappers/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'nodeunit']
},
},
concat: {
options: {
banner: '<%= banner %>'
},
gas: {
src: [
'src/wrappers/intro.js',
'src/helpers.js',
'src/core.js',
'src/plugins/*.js',
'src/wrapup.js',
'src/wrappers/outro.js'
],
dest: 'dist/gas.js',
},
core: {
src: [
'src/wrappers/intro.js',
'src/helpers.js',
'src/core.js',
'src/wrapup.js',
'src/wrappers/outro.js'
],
dest: 'dist/gas.core.js',
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
all: {
files: {
'dist/gas.min.js': 'dist/gas.js',
'dist/gas.core.min.js': 'dist/gas.core.js'
}
},
},
clean: ['dist']
});
// Default task.
grunt.registerTask('default', [
'jshint'
]);
grunt.registerTask('build', [
'default',
'clean',
'concat',
'uglify'
]);
};