-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
43 lines (38 loc) · 1.17 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
/*global module*/
module.exports = function (grunt) {
/*jshint strict:false*/
var bannerContent = '/* \n' +
' * <%= pkg.name %> v<%= pkg.version %> \n' +
' * Author: @<%= pkg.author %> \n' +
' * Date: <%= grunt.template.today("yyyy-mm-dd") %> \n' +
' * Url: <%= pkg.url %> \n' +
' * Licensed under the <%= pkg.license %> license\n' +
' */\n';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: bannerContent,
},
target: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jshint: {
options: {
eqeqeq: true,
trailing: true,
sub: true
},
target: {
src : ['src/**/*.js']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['jshint', 'uglify']);
grunt.registerTask('dev', ['jshint']);
grunt.registerTask('prd', ['jshint', 'uglify']);
};