-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathgruntfile.js
53 lines (46 loc) · 1.4 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
module.exports = function(grunt){
// This will go through package.json and load grunt task
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
var stylus = require('stylus'),
fs = require('fs');
grunt.registerTask('test', function() {
var str = fs.readFileSync('./highlight-test.stylus', { encoding: 'utf-8'}),
done = this.async();
stylus(str)
.set('filename', 'test.css')
.render(function(err, css) {
if (err) {
grunt.log.error(err);
done(false);
} else {
done(true);
}
});
});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
convert: {
yaml2plist: {
src: ['Stylus.language.yml'],
dest: 'Stylus.plist'
}
},
rename: {
move: {
src: 'Stylus.plist',
dest: 'Stylus.tmLanguage'
}
},
watch: {
html: {
files: ['Stylus.language.yml'],
tasks: ['default']
},
stylus: {
files: ['highlight-test.stylus'],
tasks: ['test']
}
}
});
grunt.registerTask('default', ['convert', 'rename', 'test']);
};