|
1 | 1 |
|
2 | | -module.exports = function(grunt) { |
3 | | - grunt.initConfig({ |
4 | | - pkg: grunt.file.readJSON('./package.json'), |
5 | | - jshint: { |
6 | | - options: { |
7 | | - jshintrc: '.jshintrc' |
8 | | - }, |
9 | | - all: ['Standards/**/*.js', 'Contrib/PhantomJS/*.js'] |
10 | | - }, |
11 | | - uglify: { |
12 | | - debug: { |
13 | | - options: { |
14 | | - compress: false, |
15 | | - mangle: false, |
16 | | - beautify: true, |
17 | | - preserveComments: true, |
18 | | - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'), |
19 | | - footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 2 | +module.exports = function (grunt) { |
| 3 | + grunt.initConfig({ |
| 4 | + pkg: grunt.file.readJSON('./package.json'), |
| 5 | + jshint: { |
| 6 | + options: { |
| 7 | + jshintrc: '.jshintrc' |
| 8 | + }, |
| 9 | + all: ['Standards/**/*.js', 'Contrib/PhantomJS/*.js'] |
20 | 10 | }, |
21 | | - files: { |
22 | | - 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js'] |
23 | | - } |
24 | | - }, |
25 | | - dist: { |
26 | | - options: { |
27 | | - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'), |
28 | | - footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 11 | + uglify: { |
| 12 | + debug: { |
| 13 | + options: { |
| 14 | + compress: false, |
| 15 | + mangle: false, |
| 16 | + beautify: true, |
| 17 | + preserveComments: true, |
| 18 | + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'), |
| 19 | + footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 20 | + }, |
| 21 | + files: { |
| 22 | + 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js'] |
| 23 | + } |
| 24 | + }, |
| 25 | + dist: { |
| 26 | + options: { |
| 27 | + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'), |
| 28 | + footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 29 | + }, |
| 30 | + files: { |
| 31 | + 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js'] |
| 32 | + } |
| 33 | + }, |
| 34 | + bookmarklet: { |
| 35 | + options: { |
| 36 | + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/header-bookmarklet.js'), |
| 37 | + footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 38 | + }, |
| 39 | + files: { |
| 40 | + 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/Auditor_with_beacon.js'] |
| 41 | + } |
| 42 | + } |
29 | 43 | }, |
30 | | - files: { |
31 | | - 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js'] |
32 | | - } |
33 | | - }, |
34 | | - bookmarklet: { |
35 | | - options: { |
36 | | - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/header-bookmarklet.js'), |
37 | | - footer: grunt.file.read('Contrib/Build/umd-footer.js') |
| 44 | + copy: { |
| 45 | + dist: { |
| 46 | + files: [ |
| 47 | + { |
| 48 | + expand: true, |
| 49 | + flatten: true, |
| 50 | + src: 'Auditor/HTMLCSAuditor.css', |
| 51 | + rename: function (dest, src) { |
| 52 | + return dest + '/HTMLCS.css'; |
| 53 | + }, |
| 54 | + dest: 'build', |
| 55 | + filter: 'isFile' |
| 56 | + }, { |
| 57 | + expand: true, |
| 58 | + flatten: true, |
| 59 | + src: 'Auditor/Images/*', |
| 60 | + dest: 'build/Images', |
| 61 | + filter: 'isFile' |
| 62 | + }, { |
| 63 | + expand: true, |
| 64 | + flatten: true, |
| 65 | + src: 'licence.txt', |
| 66 | + dest: 'build', |
| 67 | + filter: 'isFile' |
| 68 | + } |
| 69 | + ] |
| 70 | + } |
38 | 71 | }, |
39 | | - files: { |
40 | | - 'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/Auditor_with_beacon.js'] |
| 72 | + watch: { |
| 73 | + jade: { |
| 74 | + files: ['<%= jshint.all %>'], |
| 75 | + tasks: ['jshint:all'] |
| 76 | + } |
41 | 77 | } |
42 | | - } |
43 | | - }, |
44 | | - copy: { |
45 | | - dist: { |
46 | | - files: [ |
47 | | - { |
48 | | - expand: true, |
49 | | - flatten: true, |
50 | | - src: 'Auditor/HTMLCSAuditor.css', |
51 | | - rename: function(dest, src) { |
52 | | - return dest + '/HTMLCS.css'; |
53 | | - }, |
54 | | - dest: 'build', |
55 | | - filter: 'isFile' |
56 | | - }, { |
57 | | - expand: true, |
58 | | - flatten: true, |
59 | | - src: 'Auditor/Images/*', |
60 | | - dest: 'build/Images', |
61 | | - filter: 'isFile' |
62 | | - }, { |
63 | | - expand: true, |
64 | | - flatten: true, |
65 | | - src: 'licence.txt', |
66 | | - dest: 'build', |
67 | | - filter: 'isFile' |
68 | | - } |
69 | | - ] |
70 | | - } |
71 | | - }, |
72 | | - watch: { |
73 | | - jade: { |
74 | | - files: ['<%= jshint.all %>'], |
75 | | - tasks: ['jshint:all'] |
76 | | - } |
77 | | - } |
78 | | - }); |
79 | | - grunt.file.setBase('./'); |
80 | | - require('load-grunt-tasks')(grunt); |
| 78 | + }); |
| 79 | + |
| 80 | + grunt.file.setBase('./'); |
| 81 | + require('load-grunt-tasks')(grunt); |
81 | 82 |
|
82 | | - grunt.registerTask('default', ['jshint']); |
83 | | - grunt.registerTask('build', ['uglify:dist', 'copy:dist']); |
84 | | - grunt.registerTask('build-bookmarklet', ['uglify:bookmarklet', 'copy:dist']); |
| 83 | + grunt.registerTask('default', ['jshint']); |
| 84 | + grunt.registerTask('build', ['uglify:dist', 'copy:dist']); |
| 85 | + grunt.registerTask('build-bookmarklet', ['uglify:bookmarklet', 'copy:dist']); |
85 | 86 |
|
86 | | - return grunt.registerTask('build-debug', ['uglify:debug', 'copy:dist']); |
| 87 | + return grunt.registerTask('build-debug', ['uglify:debug', 'copy:dist']); |
87 | 88 | }; |
0 commit comments