Last active
April 10, 2016 20:21
-
-
Save topdown/940a0af716fc386517ed2169fa7ffc4f to your computer and use it in GitHub Desktop.
Network wide WordPress theme development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://mattbanks.me/grunt-wordpress-development-deployments/ | |
// https://github.com/mattbanks/WordPress-Starter-Theme/blob/master/Gruntfile.js | |
'use strict'; | |
module.exports = function (grunt) { | |
// load all grunt tasks matching the `grunt-*` pattern | |
require('load-grunt-tasks')(grunt); | |
var $proxy = 'vvv_domain.dev'; | |
grunt.initConfig({ | |
// watch for changes and trigger sass, jshint, uglify and livereload | |
watch: { | |
// sass: { | |
// files: ['src/compass/sass/**/*.{scss,sass}'], | |
// tasks: ['sass'] | |
// }, | |
html: { | |
files: ['**/*.{html,php}'] | |
}, | |
css: { | |
files: ['style.css'] | |
} | |
}, | |
// sass | |
// sass: { | |
// dist: { | |
// options: { | |
// style: 'expanded' | |
// }, | |
// files: { | |
// 'style.css': 'src/compass/sass/style.scss' | |
// //'editor-style.css': 'src/compass/sass/editor-style.scss' | |
// } | |
// } | |
// }, | |
// autoprefixer | |
autoprefixer: { | |
options: { | |
browsers: ['last 2 versions', 'ie 9', 'ios 6', 'android 4'], | |
map: true | |
}, | |
files: { | |
expand: true, | |
flatten: true, | |
src: '*.css', | |
dest: 'src/css' | |
} | |
}, | |
// css minify | |
cssmin: { | |
options: { | |
keepSpecialComments: 1 | |
}, | |
minify: { | |
expand: true, | |
cwd: '', | |
src: ['*.css', '!*.min.css'], | |
ext: '.css' | |
} | |
}, | |
// image optimization | |
// imagemin: { | |
// dist: { | |
// options: { | |
// optimizationLevel: 7, | |
// progressive: true, | |
// interlaced: true | |
// }, | |
// files: [{ | |
// expand: true, | |
// cwd: 'src/img/', | |
// src: ['**/*.{png,jpg,gif}'], | |
// dest: 'src/images/' | |
// }] | |
// } | |
// }, | |
// browserSync | |
browserSync: { | |
dev: { | |
bsFiles: { | |
src: ['style.css', '**/*.{html,php}'] | |
}, | |
options: { | |
proxy: $proxy, | |
watchTask: true, | |
browser: "google chrome" | |
} | |
} | |
} | |
}); | |
// rename tasks | |
grunt.renameTask('rsync', 'deploy'); | |
grunt.registerTask('default', ['browserSync', 'watch']); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "your_theme", | |
"version": "1.0.0", | |
"description": "", | |
"main": "Gruntfile.js", | |
"dependencies": { | |
"grunt": "^0.4.5", | |
"grunt-autoprefixer": "^3.0.3", | |
"grunt-contrib-cssmin": "^0.13.0", | |
"grunt-browser-sync": "^2.1.3", | |
"grunt-contrib-sass": "^0.9.2", | |
"grunt-rsync": "^0.6.2", | |
"grunt-contrib-jshint": "^0.11.3", | |
"grunt-contrib-watch": "^0.6.1", | |
"grunt-spritesmith": "^5.2.0", | |
"load-grunt-tasks": "^3.2.0" | |
}, | |
"devDependencies": {}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
@MickeyKay let me know how it works for you. I have been using this setup a lot.
Mac OSX as the VVV setup where I develop and then viewing across the network on all devices and machines for browser testing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow, if this works. . . awesome! Thanks Jeff!