forked from yabwe/medium-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
123 lines (109 loc) · 3.07 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*global module, require*/
module.exports = function(grunt) {
'use strict';
var gruntConfig = {
pkg: grunt.file.readJSON('package.json')
};
gruntConfig.jslint = {
files: ['src/js/**/*.js', 'spec/*.js', 'Gruntfile.js'],
directives: {
browser: true,
unparam: true,
todo: true,
debug: true
}
};
gruntConfig.jasmine = {
suite: {
src: 'src/js/**/*.js',
options: {
specs: 'spec/*.spec.js',
helpers: 'spec/helpers/*.js',
styles: 'dist/css/*.css',
junit: {
path: "reports/jasmine/",
consolidate: true
},
keepRunner: true,
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/jasmine/coverage.json',
report: 'coverage'
}
}
}
};
gruntConfig.uglify = {
options: {
report: 'gzip'
},
build: {
src: 'src/js/medium-editor.js',
dest: 'dist/js/<%= pkg.name %>.min.js'
}
};
gruntConfig.csslint = {
strict: {
options: {
'box-sizing': false,
'import': 2
},
src: 'dist/css/**/*.css'
}
};
gruntConfig.compass = {
dist: {
options: {
sassDir: 'src/sass',
cssDir: 'dist/css',
outputStyle: 'compressed',
noLineComments: true
}
}
};
gruntConfig.watch = {
scripts: {
files: ['src/js/**/*.js', 'spec/*.js', 'Gruntfile.js'],
tasks: ['js'],
options: {
debounceDelay: 250
}
},
styles: {
files: 'src/sass/**/*.scss',
tasks: ['css'],
options: {
debounceDelay: 250
}
}
};
gruntConfig.concat = {
options: {
stripBanners: true
},
dist: {
src: 'src/js/medium-editor.js',
dest: 'dist/js/<%= pkg.name %>.js'
}
};
gruntConfig.plato = {
feed: {
files: {
'reports/plato': ['src/js/medium-editor.js']
}
}
};
grunt.initConfig(gruntConfig);
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-plato');
grunt.registerTask('test', ['jslint', 'jasmine', 'csslint']);
grunt.registerTask('js', ['jslint', 'jasmine', 'uglify', 'concat']);
grunt.registerTask('css', ['compass', 'csslint']);
grunt.registerTask('default', ['js', 'css']);
};