-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
88 lines (75 loc) · 1.87 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
module.exports = function (grunt) {
/*eslint camelcase: 0*/
'use strict';
grunt.initConfig({
less: {
minify: {
options: {
cleancss: true,
report: 'min'
},
files: {
'hakyll/css/screen.css': [
'build/stylesheets/less/custom.less'
]
}
}
},
pkg: grunt.file.readJSON('package.json'),
useminPrepare: {
html: 'HTML/index.html'
},
usemin: {
html: ['HTML/index.html']
},
critical: {
build: {
options: {
base: 'HTML/',
width: 260,
height: 640
},
src: 'HTML/index.html',
dest: 'HTML/index.html'
}
},
uncss: {
build: {
files: {
'HTML/css/nicole.un.css': ['HTML/index.html']
}
}
},
cssmin: {
build: {
files: {
'HTML/css/nicole.min.css': ['HTML/css/nicole.un.css']
}
}
},
htmlmin: {
build: {
options: {
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCDATA: true,
collapseWhitespace: true,
removeAttributeQuotes: false
},
files: {
'HTML/index.html': 'HTML/index.html'
}
}
}
});
// These plugins provide necessary tasks.
//grunt.loadNpmTasks('grunt-contrib-less');
// grunt.loadNpmTasks('grunt-usemin');
// Default task.
// Load all files starting with `grunt-`
require('matchdep').filter('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['less']);
grunt.registerTask('usemin-optimize', ['useminPrepare', 'concat:generated', 'uglify:generated', 'usemin']);
grunt.registerTask('optimize', ['usemin-optimize']);
grunt.registerTask('css-mangling', ['uncss:build', 'cssmin:build', 'critical:build', 'htmlmin:build']);
};