SASS + CSS Injecting is not working since 2.24.0 version
See original GitHub issueIssue details
Browsersync detects changes in css but it does not inject the new css since 2.24.0 version. You have to manually refresh the page to see the changes
Steps to reproduce/test case
Just use example on https://browsersync.io/docs/gulp to reproduce this issue.
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./app"
});
gulp.watch("app/scss/*.scss", ['sass']);
gulp.watch("app/*.html").on('change', browserSync.reload);
});
// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("app/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.stream());
});
gulp.task('default', ['serve']);
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.24.2 ]
- Node [ 10.0.0 ]
- Npm [ 6.0.0 ]
Affected platforms
- linux
- windows
- OS X
- freebsd
- solaris
- other (please specify which)
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
If CLI, please paste the entire command below
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
gulp.task('sass', () => {
gulp
.src('src/scss/main.scss')
.pipe(ifElse(isDev, () => sourcemaps.init()))
.pipe(sass().on('error', sass.logError))
.pipe(postcss([autoprefixer()]))
.pipe(ifElse(isDev, () => sourcemaps.write()))
.pipe(ifElse(!isDev, () => cleanCSS()))
.pipe(gulp.dest('dist'))
.pipe(browserSync.stream());
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Chrome CSS injection suddenly not working - Stack Overflow
Show activity on this post. In the developer tools settings (click the cog at the top-right), you should see an "Auto-reload generated CSS"...
Read more >@weareathlon/frontend-webpack-boilerplate | Yarn - Yarn
Starter project template boilerplate based on Webpack with SASS/PostCSS and babel ES6/7 support. webpack, boilerplate, template, setup. readme. Webpack 5 ...
Read more >Ember-cli-utilities NPM | npm.io
Check Ember-cli-utilities 4.0.1 package - Last release 4.0.1 with MIT licence at our NPM packages aggregator and search engine.
Read more >ember-cli-utilities - npm Package Health Analysis - Snyk
An important project maintenance signal to consider for ember-cli-utilities is that it hasn't seen any new versions released to npm in the past ......
Read more >Webpack/VueJS PWA app upgrade problems (node-sass)
Hello Vue forums I have been tasked with maintaining and further development on one of our products. I am pretty new to Webpack...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can simply use the old version to instead.
npm uninstall browser-sync
npm install browser-sync@2.18.12
fixed in browser-sync@2.24.3