-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
105 lines (101 loc) · 2.65 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
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
libs: grunt.file.readJSON('libs.json'),
concat: {
dist: {
src: ['<%= libs.jquery %>','<%= libs.toc %>','src/scripts/*.js'],
dest: 'dist/scripts/<%= pkg.name %>.js'
}
},
uglify: {
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/scripts/<%= pkg.name %>.min.js'
}
},
jshint: {
gruntfile: {
src: 'Gruntfile.js'
},
},
sass: {
build: {
src: 'src/styles/main.scss',
dest: 'src/styles/main.css'
}
},
cssmin: {
combine: {
src: ['src/styles/fonts.css','src/bower_components/normalize-css/normalize.css','src/styles/main.css'],
dest: 'dist/styles/<%= pkg.name %>.min.css'
}
},
jade: {
options: {
data: {
title: 'Chameleon',
css_path: 'styles/<%= pkg.name %>.min.css',
script_path: 'scripts/<%= pkg.name %>.min.js'
}
},
dist: {
src: 'src/templates/index.jade',
dest: 'dist/index.html'
}
},
copy: {
dist_images: {
expand: true,
src: 'src/images/**',
dest: 'dist/images/',
flatten: true,
filter: 'isFile'
},
dist_fonts: {
exapnd:true,
src: 'src/fonts/**',
dest: 'dist/fonts/',
flatten: true,
filter: 'isFile'
}
},
watch: {
options: {
livereload:true
},
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src_test: {
files: '<%= concat.dist.src %>',
tasks: ['concat:dist','uglify:dist']
},
sass: {
files: 'src/styles/main.scss',
tasks:['sass:build','cssmin:combine'],
},
jade: {
files:'src/templates/*.jade',
tasks: ['jade:dist']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'sass', 'cssmin']);
grunt.registerTask('build', ['jshint', 'concat', 'uglify', 'sass', 'cssmin','copy','jade']);
grunt.registerTask('watcher',['watch']);
};