forked from joeldbirch/superfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
105 lines (83 loc) · 2.24 KB
/
Gruntfile.coffee
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 = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('superfish.jquery.json')
banner: """
/*
* <%= pkg.title || pkg.name %> - v<%= pkg.version %>
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;
"""
# Task configuration.
clean:
files: [
'dist'
'test/specs/**/*.js'
]
concat:
options:
banner: '<%= banner %>'
stripBanners: true
dist:
src: ['src/js/<%= pkg.name %>.js']
dest: 'dist/js/<%= pkg.name %>.js'
uglify:
options:
banner: '<%= banner %>'
dist:
src: '<%= concat.dist.dest %>'
dest: 'dist/js/<%= pkg.name %>.min.js'
copy:
dist:
files: [
{ expand: true, cwd: 'src', src: ['css/**'], dest: 'dist/' }
{ expand: true, cwd: 'src', src: ['js/hoverIntent.js','js/supersubs.js','js/jquery.js'], dest: 'dist/' }
]
jshint:
src:
options:
jshintrc: 'src/.jshintrc'
src: ['src/**/<%= pkg.name %>.js']
watch:
js:
files: '<%= jshint.src.src %>'
tasks: ['jshint:src']
style:
files: 'src/**/*.css'
tasks: ['copy']
coffee:
compile:
expand: true
cwd: ''
src: 'test/**/*.coffee'
ext: '.js'
jasmine:
customTemplate:
src: [
'src/**/*.js'
'!src/**/jquery.js'
]
options:
specs: 'test/specs/*Test.js'
helpers: 'test/helpers/**/*.js'
vendor: 'src/js/jquery.js'
template: 'test/fixtures/menu.tmpl'
styles: 'src/css/superfish.css'
keepRunner: false
# These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-jasmine')
grunt.loadNpmTasks('grunt-contrib-coffee')
# Default task.
grunt.registerTask('test', ['coffee', 'jasmine', 'clean'] )
grunt.registerTask('default', ['jshint', 'test', 'clean', 'concat', 'copy', 'uglify'])