forked from squizlabs/HTML_CodeSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.coffee
96 lines (90 loc) · 2.86 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
module.exports = (grunt)->
grunt.initConfig
pkg: grunt.file.readJSON('./package.json')
jshint:
options:
jshintrc: '.jshintrc'
all: [
'Standards/**/*.js'
'Contrib/PhantomJS/*.js'
]
uglify:
debug:
options:
compress: false
mangle: false
beautify: true
preserveComments: true
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js')
footer: grunt.file.read('Contrib/Build/umd-footer.js')
files:
'build/HTMLCS.js': [
'Translations/*.js'
'Standards/**/*.js'
'HTMLCS.js'
'HTMLCS.Util.js'
'Contrib/PhantomJS/runner.js'
'Auditor/HTMLCSAuditor.js'
]
dist:
options:
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js')
footer: grunt.file.read('Contrib/Build/umd-footer.js')
files:
'build/HTMLCS.js': [
'Translations/*.js'
'Standards/**/*.js'
'HTMLCS.js'
'HTMLCS.Util.js'
'Contrib/PhantomJS/runner.js'
'Auditor/HTMLCSAuditor.js'
],
bookmarklet:
options:
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/header-bookmarklet.js')
footer: grunt.file.read('Contrib/Build/umd-footer.js')
files:
'build/HTMLCS.js': [
'Translations/*.js'
'Standards/**/*.js'
'HTMLCS.js'
'HTMLCS.Util.js'
'Contrib/PhantomJS/runner.js'
'Auditor/Auditor_with_beacon.js'
],
copy:
dist:
files: [
{
expand: true
flatten: true,
src: 'Auditor/HTMLCSAuditor.css'
rename: (dest, src) -> dest + '/HTMLCS.css'
dest: 'build'
filter: 'isFile'
},
{
expand: true
flatten: true,
src: 'Auditor/Images/*'
dest: 'build/Images'
filter: 'isFile'
},
{
expand: true
flatten: true,
src: 'licence.txt'
dest: 'build'
filter: 'isFile'
}
]
watch:
jade:
files: ['<%= jshint.all %>']
tasks: ['jshint:all']
grunt.file.setBase './'
require('load-grunt-tasks') grunt
grunt.registerTask 'default', ['jshint']
grunt.registerTask 'build', ['uglify:dist', 'copy:dist']
grunt.registerTask 'build-bookmarklet', ['uglify:bookmarklet', 'copy:dist']
grunt.registerTask 'build-debug', ['uglify:debug', 'copy:dist']