-
Notifications
You must be signed in to change notification settings - Fork 246
/
Gruntfile.js
79 lines (75 loc) · 3.28 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('./package.json'),
eslint: {
target: ['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: function (dest, src) {
return 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'
}
]
}
}
});
grunt.file.setBase('./');
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['eslint']);
grunt.registerTask('build', ['uglify:dist', 'copy:dist']);
grunt.registerTask('build-bookmarklet', ['uglify:bookmarklet', 'copy:dist']);
return grunt.registerTask('build-debug', ['uglify:debug', 'copy:dist']);
};