forked from c3subtitles/L2S2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
99 lines (96 loc) · 2.61 KB
/
Gruntfile.js
File metadata and controls
99 lines (96 loc) · 2.61 KB
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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
stripBanners: {
block: true
},
separator: ';',
sourceMap: true
},
dist: {
src: ['public/js/beamer.js', 'public/js/read.js', 'public/js/write.js'],
dest: 'public/js/ls2s.min.js'
}
},
jasmine: {
src: 'tests/test_*.js',
options: {
specs: 'tests/specs/spec_*.js',
vendor: ['jQuery'],
styles: [''],
version: '1.11.1',
outfile: 'reports/SpecRunner.html'
}
},
jshint: {
all: ['public/js/*.js', '!public/js/*.min.js'],
beforeconcat: ['<%= concat.dist.src %>'],
afterconcat: ['<%= concat.dist.dest %>'],
options: {
jshintrc: true
}
},
karma: {
unit: {
// c.f. https://karma-runner.github.io/0.12/config/files.html
// e.g. https://github.com/karma-runner/grunt-karma/issues/33#issuecomment-24886609
configFile: 'karma.conf.js'
}
},
less: {
options: {
compress: true,
strictImports: true,
strictMath: true,
strictUnits: true,
sourceMap: true,
},
files: {
'public/css/beamer.css': 'public/css/beamer.less',
'public/css/read.css': 'public/css/read.less',
'public/css/write.css': 'public/css/write.less',
}
},
lesslint: {
options: {
csslint: {
'known-properties': true
},
less: {
paths: ['']
}
},
src: ['public/css/*.less']
},
uglify: {
options: {
// c.f. http://jshint.com/docs/options/
// e.g. https://gist.github.com/connor/1597131#file-jshintrc-js
mangle: true,
compress: true,
beautify: true,
preserveComments: 'some'
},
build: {
src: 'js/<%= pkg.name %>.js',
dest: 'js/<%= pkg.name %>.min.js'
}
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-lesslint');
// Default tasks
grunt.registerTask('default', ['less', 'concat', 'uglify']);
grunt.registerTask('lint', ['jshint', 'lesslint']);
grunt.registerTask('test', ['karma:unit', 'jasmine']);
};