-
Notifications
You must be signed in to change notification settings - Fork 4
/
Gruntfile.js
65 lines (62 loc) · 1.76 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
module.exports = function (grunt) {
grunt.initConfig({
'copy': {
dev: {
files: [{
expand: true,
src: './images/*',
dest: './gh-pages/'
}, {
src: './index.html',
dest: './gh-pages/index.html'
}, {
src: './css/style.css',
dest: './gh-pages/css/style.css'
}, {
src: './js/wheel.json',
dest: './gh-pages/js/wheel.json'
}, {
src: './js/stats.min.js',
dest: './gh-pages/js/stats.min.js'
}]
}
},
uglify: {
options: {
mangle: true,
report: "gzip"
},
my_target: {
files: [{
'gh-pages/js/orbit.js': ['js/orbit.js']
}, {
'gh-pages/js/three.js': ['js/three.js']
}, {
'gh-pages/js/slotmachine.js': ['js/slotmachine.js']
}]
}
},
replace: {
ghpages: {
src: './gh-pages/index.html',
/*dest: './gh-pages/bloxed.html',*/
overwrite: true,
replacements: [{
from: '<!--##ANALYITICS##-->',
to: "\n<script>\n\
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n\
ga('create', 'UA-17896232-1', 'auto');\n\
ga('send', 'pageview');\n\
</script>"
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-text-replace');
grunt.registerTask('default', ['uglify', 'copy', 'replace:ghpages']);
};