how-to-css | howtocss.dev - howtocss | Grid library
kandi X-RAY | how-to-css Summary
kandi X-RAY | how-to-css Summary
howtocss.dev
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of how-to-css
how-to-css Key Features
how-to-css Examples and Code Snippets
Community Discussions
Trending Discussions on how-to-css
QUESTION
I'm implementing a build using Gulp
, Browsersync
, Sass
for CSS and Pug
for HTML. I'm also injecting stylesheets s into HTML after the styles and markup are compiled.
Initial build works fine, but I'm having a problem to implement watching for changes in CSS and HTML files using Gulp. What happens now is on changing any source file (markup or stylesheets), when Browsersync reloads the browser, I'm left with an unstyled page, which has no stylesheets injected into it's . It seems that Browsersync reload fires after
pug
(Pug to HTML compilation) has been done, but before sass
(Sass to CSS compilation) finishes and so there is nothing to inject then.
Main question: Please tell me how to force the right order in Gulp.
Extra question: How to do it in a way that would do full page reload when the markup changes, but not do full page reload on stylesheet changes, instead only inject CSS into as described in this article and Gulp docs under "SASS + CSS Injecting".
This is my code:
gulpfile.babel.js
...ANSWER
Answered 2017-Apr-05 at 08:32The first thing to do is to add browserSync
to your inject:styles
task, otherwise it won't reload after the style links have been injected
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install how-to-css
Sanity.io
Sanity UI
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page