-
Notifications
You must be signed in to change notification settings - Fork 64
/
Gruntfile.js
106 lines (102 loc) · 2.27 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'),
haml: {
vocabs: {
files: [{
expand: true,
cwd: 'app/vocabs/',
src: ['*/sample.haml'],
dest: 'app/vocabs/',
ext: '.html'
}],
}
},
sass: {
app: {
files: {
'app/assets/css/happy.css': 'app/assets/scss/happy.scss',
'app/assets/css/pop-pop.css': 'app/assets/scss/pop-pop.scss'
}
},
vocabs: {
files: [{
expand: true,
cwd: 'app/vocabs/',
src: ['*/syntax.scss'],
dest: 'app/vocabs/',
ext: '.css'
}],
}
},
autoprefixer: {
options: {
browsers: ['last 10 versions']
},
app: {
files: {
'app/assets/css/happy.css': 'app/assets/css/happy.css'
}
},
vocabs: {
files: [{
expand: true,
cwd: 'app/vocabs/',
src: ['*/syntax.css'],
dest: 'app/vocabs/',
ext: '.css'
}],
}
},
devserver: {
app: {
options: {
base: 'app',
port: 2000,
async: true
}
}
},
watch: {
appfiles: {
files: [
'app/*.html',
'app/assets/css/*.css',
'app/assets/js/*.js'
],
options: {
livereload: true,
interrupt: true,
}
},
appstyles: {
files: [
'app/assets/scss/*.scss',
],
tasks: ['sass:app', 'autoprefixer:app'],
options: {
livereload: false,
interrupt: true,
}
},
vocabs: {
files: [
'app/vocabs/*/syntax.scss',
'app/vocabs/*/sample.haml',
],
tasks: ['haml:vocabs', 'sass:vocabs', 'autoprefixer:vocabs'],
options: {
livereload: false,
interrupt: true,
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-haml');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-devserver');
grunt.registerTask('serve', ['devserver']);
grunt.registerTask('default', ['watch']);
};