Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Added BrowserSync to the grunt task
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrehaut committed Feb 14, 2017
1 parent 0486b6f commit 33b116b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
50 changes: 42 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

browserSync: {
bsFiles: {
src: [
'*.php',
'**/*.php',
'Gruntfile.js',
'assets/js/*.js',
'*.css',
'assets/css/*.css'
]
},
options: {
watchTask: true,
debugInfo: true,
logConnections: true,
notify: true,
proxy: 'test-theme.uk',
ghostMode: {
scroll: true,
links: true,
forms: true
}
}
},

// Concat Task
concat: {
dist: {
Expand Down Expand Up @@ -72,13 +97,7 @@ module.exports = function(grunt) {
dateFormat: function(time) {
grunt.log.writeln('Finished in ' + time + 'ms at ' + (new Date()).toString());
grunt.log.writeln('Waiting for more changes...');
},
// Live Reload
livereload: {
options: {
livereload: true
}
},
}
},
scripts: {
files: 'assets/js/main.js', // The main JS file for the theme.
Expand All @@ -88,6 +107,20 @@ module.exports = function(grunt) {
files: 'assets/scss/**/*.scss',
tasks: ['sass','postcss'],
},
browserSync: {
files: [
'*.php',
'**/*.php',
'*.css',
'Gruntfile.js',
'*.css',
'assets/js/*.js',
'assets/css/*.css'
],
options: {
watchTask: true
}
}
},
// End Watch

Expand All @@ -105,8 +138,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browser-sync');

// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'sass', 'imagemin', 'watch']);
grunt.registerTask('default', ['browserSync', 'watch']);

};
3 changes: 1 addition & 2 deletions assets/css/style.css

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions assets/scss/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
box-sizing: border-box;
}

html {
height: auto;
html,
body {
height: 100%;
overflow: auto;
}

Expand All @@ -18,9 +19,13 @@ body {
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
display: flex;
min-height: 100vh;
flex-direction: column;
line-height: rem-calc(25);
line-height: 2;
-webkit-tap-highlight-color: transparent;
}

.site-content {
flex: 1;
}

img {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"devDependencies": {
"autoprefixer": "^6.5.3",
"grunt": "^1.0.1",
"grunt-browser-sync": "^2.2.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-imagemin": "^1.0.1",
"grunt-contrib-uglify": "^2.0.0",
Expand Down

0 comments on commit 33b116b

Please sign in to comment.