-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgruntfile.js
More file actions
101 lines (87 loc) · 2.22 KB
/
gruntfile.js
File metadata and controls
101 lines (87 loc) · 2.22 KB
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
module.exports = function(grunt) {
grunt.initConfig({
shell: {
options: {
stdout: true
},
clean: {
command: 'rm -rf build .tmp'
},
build: {
command: 'cp -r src build'
}
},
watch: {
scripts: {
files: 'src/*.djs',
tasks: ['dogescript:dev'],
options: {
spawn: false
},
},
},
rewrite: {
link: {
src: ['build/**/*.html', 'build/widget/**/*.js'],
editor: function(contents, filePath) {
return contents.replace('widget/wow-such-widget', 'http://wowsuch.io/widget/wow-such-widget');
}
}
},
useminPrepare: {
options: {
dest: 'build'
},
html: ['build/index.html']
},
usemin: {
html: ['build/index.html']
},
uglify: {
widget: {
files: {
'build/widget/wow-such-widget.js': 'src/widget/wow-such-widget.js'
}
}
},
cssmin: {
widget: {
files: {
'build/widget/wow-such-widget.css': 'src/widget/wow-such-widget.css'
}
}
},
rev: {
site: {
options: {
encoding: 'utf8',
algorithm: 'md5',
length: 8
},
files: {
src: ['build/doge.min.{js,css,png,jpg}']
}
}
},
'gh-pages': {
options: {
base: 'build'
},
src: ['**']
}
});
grunt.registerTask('buildPrep', ['shell:clean', 'shell:build'])
grunt.registerTask('buildSite', ['useminPrepare', 'concat', 'uglify:generated', 'cssmin:generated', 'rev:site', 'usemin']);
grunt.registerTask('buildWidget', ['uglify:widget', 'cssmin:widget', 'rewrite']);
grunt.registerTask('build', ['buildPrep', 'buildSite', 'buildWidget']);
grunt.registerTask('deploy', ['buildPrep', 'buildSite', 'buildWidget', 'gh-pages']);
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rewrite');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-rev');
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-gh-pages');
};