forked from Automattic/jetpack-onboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
88 lines (83 loc) · 2.9 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
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// concat: {
// dist: {
// src: [
// 'js/main/*.js',
// ],
// dest: 'js/production.js', // needs a better name, doncha think?
// }
// },
// uglify: {
// build: {
// src: 'js/production.js',
// dest: 'js/production.min.js'
// }
// },
sass: {
dist: {
options: {
// Can be nested, compact, compressed, expanded
style: 'expanded',
sourcemap: true
},
files: {
'css/jetpack-start.css': 'css/jetpack-start.scss',
'css/jetpack-start-menu.css': 'css/jetpack-start-menu.scss'
}
}
},
autoprefixer: {
options: {
// Task-specific options go here.
},
global: {
options: {
// Target-specific options go here.
// browser-specific info: https://github.com/ai/autoprefixer#browsers
// DEFAULT: browsers: ['> 1%', 'last 2 versions', 'ff 17', 'opera 12.1']
browsers: ['> 1%', 'last 2 versions', 'ff 17', 'opera 12.1', 'ie 8', 'ie 9'],
map: true
},
src: 'css/*.css'
},
},
watch: {
// options: {
// livereload: true,
// },
// scripts: {
// files: ['js/*.js'],
// tasks: ['concat', 'uglify'],
// options: {
// spawn: false,
// },
// },
css: {
files: ['css/scss/*.scss', 'css/scss/**/*.scss'],
tasks: ['sass', 'autoprefixer'],
options: {
livereload: true,
spawn: false,
}
},
php: {
files: ['*.php', '**/*.php', '**/**/*.php'],
options: {
livereload: true,
spawn: false,
}
}
}
});
// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-concat'); // concatenate
grunt.loadNpmTasks('grunt-contrib-uglify'); // minify
grunt.loadNpmTasks('grunt-contrib-watch'); // watch files for changes
grunt.loadNpmTasks('grunt-contrib-sass'); // Gettin Sassy!
grunt.loadNpmTasks('grunt-autoprefixer'); // Auto-freaking-prefixer!!!
// 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default', ['watch']);
};