forked from yabwe/medium-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
106 lines (102 loc) · 2.45 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jslint: {
files: ['src/js/**/*.js', 'spec/*.js'],
directives: {
browser: true,
unparam: true,
todo: true,
debug: true
}
},
jasmine: {
suite: {
src: 'src/js/**/*.js',
options: {
specs: 'spec/*.spec.js',
helpers: 'spec/helpers/*.js',
junit: {
path: "reports/jasmine/",
consolidate: true
},
keepRunner: true,
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/jasmine/coverage.json',
report: 'coverage'
}
}
}
},
uglify: {
build: {
src: 'src/js/medium.editor.js',
dest: 'dist/js/<%= pkg.name %>.min.js'
}
},
compass: {
dist: {
options: {
sassDir: 'src/sass',
cssDir: 'dist/css',
outputStyle: 'compressed',
noLineComments: true
}
},
},
csslint: {
strict: {
options: {
'box-sizing': false,
import: 2
},
src: 'dist/css/**/*.css'
}
},
watch: {
scripts: {
files: ['src/js/**/*.js', 'spec/*.js'],
tasks: ['js'],
options: {
debounceDelay: 250,
}
},
styles: {
files: 'src/sass/**/*.scss',
tasks: ['css'],
options: {
debounceDelay: 250,
},
}
},
concat: {
options: {
stripBanners: true
},
dist: {
src: 'src/js/medium.editor.js',
dest: 'dist/js/<%= pkg.name %>.js'
}
},
plato: {
feed: {
files: {
'reports/plato': ['src/js/medium.editor.js'],
}
},
}
});
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']);
};