-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
105 lines (102 loc) · 3.12 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
98
99
100
101
102
103
104
105
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>\n' +
' * MIT License\n' +
' */\n'
},
concat: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
src: ['src/js/jquery.freakload.js'],
dest: 'dist/js/jquery.freakload.js'
}
},
uglify: {
options: {
banner: '<%= meta.banner %>'
},
my_target: {
src: ['dist/js/jquery.freakload.js'],
dest: 'dist/js/jquery.freakload.min.js'
}
},
less: {
development: {
options: {
paths: ['assets/css']
},
files: {
'assets/css/main.css': 'assets/less/main.less'
}
},
production: {
options: {
paths: ['assets/css'],
compress: true,
cleancss: true
},
files: {
'assets/css/main.min.css': 'assets/less/main.less'
}
}
},
jshint: {
files: ['./*.js', 'src/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
jasmine: {
src: 'src/**/*.js',
options: {
vendor: [
'assets/vendor/jquery/dist/jquery.min.js',
'assets/vendor/jasmine-jquery/lib/jasmine-jquery.js'
],
specs: 'test/*.spec.js'
}
},
connect: {
server: {
options: {
port: 9000,
hostname: 'localhost',
livereload: true
}
}
},
watch: {
options: {
livereload: true
},
scripts: {
files: ['./*.js', 'test/**/*.js', 'src/**/*.js'],
tasks: ['jshint', 'concat', 'uglify']
},
css: {
files: '**/*.less',
tasks: ['less']
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('server', ['connect', 'watch']);
grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('build', ['jshint', 'concat', 'uglify', 'less']);
};