diff --git a/Sesion3-de-Sass-a-PostCSS/without-sass/gulpfile.js b/Sesion3-de-Sass-a-PostCSS/without-sass/gulpfile.js index ba5fa03..8550600 100644 --- a/Sesion3-de-Sass-a-PostCSS/without-sass/gulpfile.js +++ b/Sesion3-de-Sass-a-PostCSS/without-sass/gulpfile.js @@ -5,6 +5,15 @@ var simplevars = require('postcss-simple-vars'); var cssimport = require('postcss-import'); var mixins = require('postcss-mixins'); var nested = require('postcss-nested'); +var browserSync = require('browser-sync').create(); + + +gulp.task('serve', function() { + browserSync.init({ + server: "./", + port: '8082' + }); +}); gulp.task('css', function() { var processors = [ @@ -21,7 +30,9 @@ gulp.task('css', function() { gulp.task('watch', function() { gulp.watch('src/**/*.css', ['css']); + gulp.watch("src/**/*.html").on('change', browserSync.reload); + gulp.watch("src/**/*.css").on('change', browserSync.reload); }); -gulp.task('default', ['css', 'watch']); +gulp.task('default', ['css', 'serve', 'watch']); diff --git a/Sesion3-de-Sass-a-PostCSS/without-sass/package.json b/Sesion3-de-Sass-a-PostCSS/without-sass/package.json index 9b6bc08..faf71be 100644 --- a/Sesion3-de-Sass-a-PostCSS/without-sass/package.json +++ b/Sesion3-de-Sass-a-PostCSS/without-sass/package.json @@ -1,7 +1,6 @@ { "name": "withoutSass", "version": "1.0.0", - "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -11,11 +10,13 @@ "license": "ISC", "devDependencies": { "autoprefixer": "^6.3.6", + "browser-sync": "^2.12.4", "gulp": "^3.9.1", "gulp-postcss": "^6.1.0", "postcss-import": "^8.1.0", "postcss-mixins": "^4.0.1", "postcss-nested": "^1.0.0", "postcss-simple-vars": "^1.2.0" - } + }, + "description": "" } diff --git a/Sesion3-de-Sass-a-PostCSS/without-sass/src/html/index.html b/Sesion3-de-Sass-a-PostCSS/without-sass/src/html/index.html new file mode 100644 index 0000000..ec086f1 --- /dev/null +++ b/Sesion3-de-Sass-a-PostCSS/without-sass/src/html/index.html @@ -0,0 +1,12 @@ + + + + + Document + + + +

Pruebas de reload html y css

+ + + \ No newline at end of file