I thought the culprit was browser-sync or Windows 10 not reading single quotes or environmental variables. I checked the syntax. Seems fine. It runs in node, compiles and apparently performs all the .tasks that I ask of it. But keeps going to the cannot get page. 'Live Server' in VS.Code finds the index.html and displays it fine.
var gulp = require('gulp')
var browserSync = require('browser-sync').create()
var sass = require('gulp-sass')
gulp.task('compile-sass', function() {
return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss',
'src/scss/*.scss'])
.pipe(sass())
.pipe(gulp.dest('src/css'))
.pipe(browserSync.stream())
})
gulp.task('move-js', function() {
return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/jquery/dist/jquery/jquery.min.js'])
.pipe(gulp.dest('src/js'))
.pipe(browserSync.stream())
})
gulp.task('launch-browser', ['compile-sass'], function() {
browserSync.init({
server: "./src"
})
gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss',
'src/scss/*.scss'],['compile-sass'])
gulp.watch("src/*.html").on('change', browserSync.reload)
})
gulp.task('default', ['move-js', 'launch-browser'])
...I've changed 'launch-browser' to 'server', I've rewrote using 'const' instead of 'var'. Any point in the right direction would be just great. I've read and tried all other posts here. All to the same end.
Comments
Post a Comment