-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
83 lines (78 loc) · 2.06 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
var rootPath = "wp-content/themes/andrewheins",
assetPath = rootPath + "/_assets";
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
/*
options: {
compress: true,
yuicompress: true,
optimization: 10,
},
*/
files: {
// target.css file: source.less file
"wp-content/themes/andrewheins/style.css": assetPath + "/css/main.less"
}
}
},
uglify: {
my_target: {
options: {
sourceMap: true,
beautify: true
},
files: {
// JS that fires just before the closing </body> tag goes in global
"wp-content/themes/andrewheins/_assets/js/output/global.min.js": [
assetPath + "/js/lib/underscore.js",
assetPath + "/js/lib/backbone.js",
//assetPath + "/js/lib/fast-active.js",
//assetPath + "/js/lib/fastclick.js",
//assetPath + "/js/lib/jquery.transit.js",
assetPath + "/js/lib/fitvids.js",
assetPath + "/js/main.js",
],
// JS that fires in wp_head goes in preload
"wp-content/themes/andrewheins/_assets/js/output/preload.min.js": [
assetPath + "/js/lib/modernizr.js",
//assetPath + "/js/lib/picturefill.js"
]
}
}
},
stripmq: {
desktop: {
options: {
width: 1080,
type: 'screen'
},
files: {
'wp-content/themes/andrewheins/style-desktop.css': ['wp-content/themes/andrewheins/style.css']
}
},
},
watch: {
styles: {
files: [assetPath + "/css/**/*.less"], // which files to watch
tasks: ["less", "stripmq"],
options: {
spawn: false
}
},
scripts: {
files: [assetPath + "/js/**/*.js"], // which files to watch
tasks: ["uglify"],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks('grunt-stripmq');
grunt.registerTask("default", ["watch"]);
};