/
Gruntfile.js
73 lines (65 loc) · 1.89 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
module.exports = function(grunt) {
// project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
glob_to_multiple: {
expand: true,
flatten: true,
cwd: 'public/javascripts/coffee/',
src: ['*.coffee'],
dest: 'public/javascripts/js/',
ext: '.js'
}
},
less: {
development: {
options: {
paths: ["public/stylesheets/less/"]
},
files: {
"public/stylesheets/css/main.css": "public/stylesheets/less/main.less",
"public/stylesheets/css/questionnaire_list.css": "public/stylesheets/less/questionnaire_list.less",
"public/stylesheets/css/questionnaire_detail.css": "public/stylesheets/less/questionnaire_detail.less",
"public/stylesheets/css/questionnaire_create.css": "public/stylesheets/less/questionnaire_create.less"
}
}
},
// ejs: {
// all: {
// src: [
// 'views/main_page.ejs',
// 'views/questionnaire_list_page.ejs',
// 'views/questionnaire_detail_page.ejs',
// 'views/questionnaire_create_page.ejs'
// ],
// dest: 'views/test_mock_html/',
// expand: true,
// ext: '.html'
// }
// },
express: {
dev: {
options: {
script: 'app.js'
}
}
},
watch: {
express: {
files: ['**/*.less', '**/*.ejs', '**/*.coffee', '**/*.js'],
tasks: ['less', 'coffee', 'express:dev'],
options: {
spawn: false,
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
// grunt.loadNpmTasks('grunt-ejs');
grunt.loadNpmTasks('grunt-express-server');
grunt.registerTask('default', ['less', 'coffee', 'express', 'watch']);
}