-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
52 lines (49 loc) · 1.12 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
var gruntConfig = {
pkg: require('./package.json'),
srcDir: '<%= pkg.config.srcDir %>',
buildDir: '<%= pkg.config.buildDir %>',
stylesDir: '<%= pkg.config.stylesDir %>',
packagesDir: '<%= pkg.config.packagesDir %>',
watch: {
css: {
files: '<%= stylesDir %>/**/*.styl',
tasks: ['stylus:dev']
}
},
jshint: {
grunt: {
src: 'Gruntfile.js',
options: {
jshintrc: '.jshintrc'
}
},
src: {
src: '<%= srcDir %>/**/*.js',
options: {
jshintrc: '<%= srcDir %>/.jshintrc'
}
}
},
stylus: {
options: {
compress: false,
'include css': true
},
dev: {
files: {
'<%= buildDir %>/app.css': '<%= stylesDir %>/main.styl'
}
}
}
};
module.exports = function(grunt) {
// Инициализируем конфиг
grunt.initConfig(gruntConfig);
// Подключаем таски
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-stylus');
// Регистрируем таски
grunt.registerTask('default', 'watch');
grunt.registerTask('build', ['jshint', 'stylus']);
};