This repository has been archived by the owner on Jan 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
93 lines (86 loc) · 2.49 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
module.exports = function (grunt) {
grunt.initConfig({
uglify: {
js: {
files: {
'assets/js/site.js': [
'assets/js/modernizr.js',
'assets/js/polyfills.js',
'assets/js/scripts.js',
],
},
},
},
sass: {
site: {
options: {
style: 'compressed',
},
files: {
'assets/css/site.css': [
'assets/sass/public.sass',
],
}
},
},
filerev: {
options: {
encoding: 'utf8',
algorithm: 'sha256',
length: 8,
},
images: {
src: 'assets/images/*.{jpg,png,svg}',
dest: 'weasyl/static/images',
},
js: {
src: 'assets/js/site.js',
dest: 'weasyl/static/js',
},
css: {
src: 'assets/css/site.css',
dest: 'weasyl/static/style',
},
},
filerev_assets: {
dist: {
options: {
dest: 'weasyl/assets.json',
cwd: 'weasyl/',
},
},
},
usemin: {
css: ['assets/css/site.css'],
},
watch: {
images: {
files: ['assets/images/*.{jpg,png,svg}'],
tasks: ['filerev:images', 'usemin', 'filerev', 'filerev_assets'],
},
js: {
files: ['assets/js/{scripts,modernizr,polyfills}.js'],
tasks: ['uglify', 'filerev', 'filerev_assets'],
},
sass: {
files: ['assets/sass/*.sass'],
tasks: ['sass', 'filerev:images', 'filerev:js', 'usemin', 'filerev:css', 'filerev_assets'],
},
},
});
grunt.loadNpmTasks('grunt-filerev');
grunt.loadNpmTasks('grunt-filerev-assets');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-usemin');
grunt.registerTask('default', [
'uglify',
'sass',
'filerev:images',
'filerev:js',
'usemin',
'filerev:css',
'filerev_assets',
]);
};