-
Notifications
You must be signed in to change notification settings - Fork 2
/
gruntfile.js
80 lines (71 loc) · 2.26 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
'use strict';
module.exports = function(grunt) {
var growl = require('growl');
var path = require('path');
var shell = require('shelljs');
var bin = ['node_modules', '.bin'].join(path.sep);
var lsc = [bin, 'lsc'].join(path.sep);
var npm = 'npm';
grunt.registerTask('livescript_src', 'update LiveScript source', function () {
var done = this.async();
// FIXME: Compile changed file only
shell.exec([npm, 'run', 'prepublish'].join(' '));
grunt.task.run('test');
done();
});
grunt.registerTask('package_ls', 'update package.ls', function () {
var done = this.async();
shell.exec([lsc, '-cj', 'package.ls'].join(' '));
shell.exec([npm, 'install'].join(' '));
growl('Update package.ls', { title: 'Completed' });
done();
});
grunt.registerTask('test', 'run test', function () {
var done = this.async();
shell.exec([npm, 'test'].join(' '));
done();
});
grunt.initConfig({
watch: {
livescript_src: {
files: ['lib/**/*.ls', 'test/**/*.ls', 'public/js/**/*.ls'],
tasks: ['livescript_src']
},
package_ls: {
files: ['package.ls'],
tasks: ['package_ls']
},
css: {
files: 'public/stylesheets/src/*.styl',
tasks: ['stylus'],
options: {
livereload: true
}
}
},
nodemon: {
dev: {
options: {
file: 'start.js',
ignoredFiles: ['README.md', 'node_modules/**'],
watchedExtensions: ['js', 'jade'],
delayTime: 1
}
}
},
stylus: {
compile: {
options: {
compress: true
},
files: {
'public/stylesheets/main.css': ['public/stylesheets/src/*.styl']
}
}
}
});
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
};