-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
123 lines (108 loc) · 3.64 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = function(grunt) {
grunt.initConfig({
paths: {
scss: './scss',
css: './assets/css'
},
buildType: 'Build',
pkg: grunt.file.readJSON('package.json'),
archive_name: grunt.option('name') || 'Emilee',
clean: {
pre: ['dist/', 'build/'],
post: ['<%= archive_name %>.zip']
},
compress: {
main: {
options: {
archive: '<%= archive_name %>.zip'
},
expand: true,
cwd: 'build/',
src: ['**/*'],
dest: ''
}
},
copy: {
main: {
files: [
{expand: true, src: ['assets/css/**'], dest: 'build/'},
{expand: true, src: ['assets/fonts/**'], dest: 'build/'},
{expand: true, src: ['assets/images/**'], dest: 'build/'},
{expand: true, src: ['assets/js/**'], dest: 'build/'},
{expand: true, src: ['partials/**'], dest: 'build/'},
{expand: true, src: ['scss/**'], dest: 'build/'},
{expand: true, src: ['*', '!.gitignore', '!.DS_Store'], dest: 'build/'},
]
},
archive: {
files: [
{expand: true, src: ['<%= archive_name %>.zip'], dest: 'dist/'}
]
}
},
sass: {
admin: {
options : {
// Only enable sourcemaps if you have Sass 3.3 installed.
sourcemap: true,
//style: 'compressed'
},
files: {
'<%= paths.css %>/style.css': '<%= paths.scss %>/style.scss',
'<%= paths.css %>/ie.css': '<%= paths.scss %>/ie.scss'
}
}
},
watch: {
sass: {
files: './scss/**/*.scss',
tasks: ['sass:admin'],
options: {
livereload: true,
}
},
templates: {
files: ['./*.hbs', './partials/**/*.hbs'],
options: {
livereload: true,
}
}
},
bowercopy: {
options: {
},
modernizr: {
files: {
'scss/_normalize.scss': 'normalize-css/normalize.css'
}
}
},
csslint: {
strict: {
options: {
import: 2
},
src: ['<%= paths.css %>/*.css']
},
lax: {
options: {
},
src: ['<%= paths.css %>/*.css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-contrib-csslint');
//default task to get from bower, build Sass
grunt.registerTask('default', ['bowercopy:modernizr', 'sass:admin']);
//also try 'grunt watch' to build sass and livereload page whenever files change
//used by Travis-CI to build and test
grunt.registerTask('build', ['bowercopy', 'sass', 'copy:main']);
grunt.registerTask('test', ['sass']);
//grunt.registerTask('bundle', ['clean:pre', 'copy:main', 'compress', 'copy:archive', 'clean:post']);
};