-
-
Save ntry/8a87ecb8427f044211dc3bfa390ff971 to your computer and use it in GitHub Desktop.
var gulp = require('gulp'); | |
var browserSync = require('browser-sync').create(); | |
var sass = require('gulp-sass'); | |
// Compile sass into CSS & auto-inject into browsers | |
gulp.task('sass', function() { | |
return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss']) | |
.pipe(sass()) | |
.pipe(gulp.dest("src/css")) | |
.pipe(browserSync.stream()); | |
}); | |
// Move the javascript files into our /src/js folder | |
gulp.task('js', function() { | |
return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js']) | |
.pipe(gulp.dest("src/js")) | |
.pipe(browserSync.stream()); | |
}); | |
// Static Server + watching scss/html files | |
gulp.task('serve', gulp.series('sass', function() { | |
browserSync.init({ | |
server: "./src" | |
}); | |
gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], gulp.series('sass')); | |
gulp.watch("src/*.html").on('change', browserSync.reload); | |
})); | |
gulp.task('default', gulp.parallel('js','serve')); |
really... a legend ... 🥇
Thanks bro
Thank you!!
Saviour!!!
Thank you!!!
thank you! you save me alot of time lol
THANK YOU! It wouldn't work until I found this in the comments! I wish the tutorial's author would respond, I still have questions!
save the day~~!
thanks!
Hi,
Thanks for the code! Can you please explain how I can import selective JavaScript from Bootstrap in this set up and change the bootstrap.min.js? I'm talking about @import 'node_modules/bootstrap/scss/_dropdown.scss'; for example.
Regard & Thanks,
David
Dude, you rock, thanks a ton!
Muy bueno. Gracias amigo.
Thank you! After 48 hours of fumbling with this, this really made my day.
legend thank you very much
You deserve the world!!! Thank you, seriously! Freaking legend!
Muito bom, resolveu meu problema.
thank you
hero
Thanks! :D
You're a legend <3