Last active
December 16, 2016 23:52
-
-
Save windycitymoon/6bc08a4ac320f963ed3041a6ce844e9d to your computer and use it in GitHub Desktop.
A Grunt task to use with the Gesso base theme.
This file contains 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
/* browserSync.js | |
1. Place this in the Gesso theme's task/config folder | |
2. Be sure to update the localDev variable | |
*/ | |
module.exports = function(grunt) { | |
var paths = { | |
localDev: "http://wpsandbox:8888", // Set this to your site's localhost | |
js: ['<%= pkg.themePath %>/js/**/*.js'], | |
html: ['<%= pkg.themePath %>/**/*.{html,php,twig}', '<%= pkg.themePath %>/pattern-lab/source/**/*.{twig,json}'], | |
images: ['<%= pkg.themePath %>/images/**/*.{png,jpg,jpeg,gif,webp,svg}'], | |
css: ['<%= pkg.themePath %>/css/**/*.css'], | |
sass: ['<%= pkg.themePath %>/sass/**/*.scss'] | |
}; | |
grunt.config.merge({ | |
browserSync: { | |
files: [paths.css, paths.html], | |
options: { | |
minify: false, | |
notify: false, | |
open: true, | |
proxy: paths.localDev, | |
watchTask: true | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-browser-sync'); | |
}; |
This file contains 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
/* gessoBroswerSync.js | |
1. Place this in the Gesso theme's task/register folder | |
2. Be sure to add this task to your default Grunt task, insert BEFORE the default watch task | |
*/ | |
module.exports = function (grunt) { | |
grunt.registerTask('gessoBrowserSync', [ | |
'browserSync' | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment