-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
80 lines (69 loc) · 2.29 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
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
'pkg': grunt.file.readJSON('package.json'),
'banner': {
'full': [
'/*!',
' * GestureKit Particles v<%= pkg.version %>',
' * http://gesturekit.com/',
' *',
' * Copyright (c) <%= grunt.template.today("yyyy") %>, RoamTouch',
' * Released under the Apache v2 License.',
' * http://gesturekit.com/',
' */\n'
].join('\n'),
'min': '/*! GestureKit Particles v<%= pkg.version %> http://gesturekit.com/ | Released under the Apache v2 License. */'
},
'concat': {
'options': {
'stripBanners': {
'options': {
'block': true,
'line': true
}
}
},
'js': {
'options': {
'banner': '<%= banner.full %>'
},
'src': ['./index.js'],
'dest': './dist/gesturekit.particles.js'
}
},
'uglify': {
'options': {
'mangle': true,
'banner': '<%= banner.min %>'
},
'js': {
'src': ['<%= concat.js.src %>'],
'dest': './dist/gesturekit.particles.min.js'
}
},
'jslint': { // configure the task
'files': ['<%= concat.js.dest %>'],
'directives': {
'browser': true,
'nomen': true,
'todo': true
},
'options': {
'errorsOnly': true, // only display errors
'failOnError': false, // defaults to true
'shebang': true, // ignore shebang lines
}
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jslint');
// Resgister task(s).
grunt.registerTask('default', []);
grunt.registerTask('dev', ['concat']);
grunt.registerTask('lint', ['dev', 'jslint']);
grunt.registerTask('dist', ['dev', 'uglify']);
};