-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
83 lines (72 loc) · 1.97 KB
/
Gruntfile.js
File metadata and controls
83 lines (72 loc) · 1.97 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
/*
* ContentsJS
* https://github.com/LittleHelicase/ContentsJS
*
* Copyright (c) 2014 "LittleHelicase" Maximilian Klein
* Licensed under the MIT license.
* https://github.com/LittleHelicase/ContentsJS/blob/master/LICENSE
*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Before generating any new files, remove any previously-created files.
clean: {
// test: ['build'],
src: ['build'],
test: ['test/**/*-test.js']
},
// Configuration to be run (and then tested).
livescript: {
test: {
expand: true,
cwd: 'test/',
src: ['**/*.ls'],
dest: 'test/',
ext: '.js'
},
src: {
expand: true,
cwd: 'src/',
src: ['**/*.ls'],
dest: 'build/',
ext: '.js'
},
},
watch : {
ls: {
files: ['src/**/*.ls'],
tasks: ['clean','build','browserify'],
},
livereload: {
options: {livereload: true},
files: ['build/**/*']
}
},
mochacli: {
options: {
require: ["test/require"],
reporter: 'mocha-unfunk-reporter'
},
any: {
src: ['test/**/*-test.js']
}
},
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// The clean plugin helps in testing.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-livescript');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.registerTask('build', ['livescript:src']);
// after testing clean the test directory
grunt.registerTask('test', ['livescript:test', 'mochacli', 'clean:test']);
// By default, lint and run all tests.
grunt.registerTask('default', ['build', 'test']);
grunt.registerTask('web', ['clean', 'build']);
grunt.registerTask('continuous', ['watch']);
};