-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
106 lines (95 loc) · 2.79 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
94
95
96
97
98
99
100
101
102
103
104
105
106
module.exports = function(grunt){
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
// grunt.registerTask('default', ['jshint', 'uglify', 'copyto', 'smushit', 'phplint']);
grunt.registerTask('default', ['uglify', 'sass', 'autoprefixer']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
js: {
files: ['webroot/js/custom.js'],
tasks: ['uglify']
},
css: {
files: ['webroot/scss/*'],
tasks: ['sass', 'autoprefixer']
}
// img: {
// files: ['app/webroot/img/*.png', 'app/webroot/img/*.jpg'],
// tasks: ['smushit']
// },
// php: {
// files: ['**/*.php'],
// tasks: ['phplint'],
// options: {
// nospawn: true,
// },
// }
},
//JavaScript
// jshint: {
// all: ['html/js/jquery.dev.js']
// },
uglify: {
options: {
mangle: false,
compress: false
},
build: {
files: [
{'/vagrant/cakephp/webroot/js/main.js': [
'/vagrant/cakephp/vendor/components/modernizr/modernizr.js',
'/vagrant/cakephp/vendor/components/jquery/jquery.js',
'/vagrant/cakephp/vendor/zurb/foundation/dist/js/foundation.js',
'/vagrant/cakephp/vendor/zurb/foundation/dist/js/plugins/foundation.core.min.js',
'/vagrant/cakephp/vendor/zurb/foundation/dist/js/plugins/foundation.util.*.min.js',
'/vagrant/cakephp/vendor/zurb/foundation/dist/js/plugins/foundation!(.util.|.zf.|.core)*.min.js',
'/vagrant/cakephp/webroot/js/custom.js'
]}
]
}
},
autoprefixer: {
options: {
browsers: [
"> 1%",
"last 2 versions",
"ie >= 9",
"opera >= 10",
"Android >= 2.3"
]
},
files: {
src: ["webroot/css/custom.css"]
}
},
//CSS
sass: {
options: {
loadPath: ['vendor/zurb/foundation/scss', 'node_modules/foundation-icons'],
style : 'expanded'
},
dev: {
files: [{
expand: true,
cwd: 'webroot/scss',
src: ['*.scss'],
dest: 'webroot/css/',
ext: '.css'
}]
/*files : {'/vagrant/cakephp/webroot/css/main.css' : [
// '/vagrant/cakephp/vendor/components/normalize.css/normalize.css',
'vendor/zurb/foundation/scss/foundation.scss'
// '/vagrant/cakephp/webroot/css/cake.css',
// '/vagrant/cakephp/webroot/css/home.css',
// '/vagrant/cakephp/webroot/sass/*.sass'
]
}*/
}
}
});
// Event handling
// grunt.event.on('watch', function(action, filepath) {
// //only lint the changed file
// grunt.config(['phplint', 'all'], filepath);
// });
};