Logbuch
browsersync reload on sass/scss
Browsersync not reloading or injecting css changes-workaround
Let´s say you have a file structure like this:
build
-script
--default.min.js
-styles
--default.min.css
js
-default.js
sass
_head.scss
_body.scss
_footer.scss
default.css
On every scss change grunt(should work with gulp as well)will generate a new default.min.css file in your build/styles folder without reloading the browser in connection the old file is updated or replaced.The trick is,that browsersync doesn´t trigger on css but on scss file extensions.So the only thing you have to do is to generate the default.min.css twice for example as default-reload.scss inside the build/styles folder and browsersync will trigger at the right time.
So if you are using the grunt-contrib-cssmin plugin add another task like this:
cssmin:{
...
default:{
files:{
'build/styles/default.min.css':'sass/default.css'
},
},
syncTrigger:{
files:{
'build/styles/default-reload.scss':'sass/default.css'
},
},
},
That´s it.Maybe there is a faster way,if you use concat and duplicate the default.css.min file an just rename it to.scss.Leave a comment the way you did it.
Blog News
Blog Cloud
- Accordion
- Adapter
- Adobe
- Affinity
- Allen & Heath
- Analytics
- Android
- Apple
- Automator
- BackUp
- Benutzer
- Box
- Browser
- Bug
- caldigit
- caldigit ts3+
- Check
- Chrome
- CMS
- Composer
- Contao
- Contao 4
- Controller
- Crative Suite
- Cross
- CS6
- CSS
- cut
- DB2
- Design
- dockingstation
- Drax
- DSM
- El Capitan
- Erweiterung
- Festivals
- Film
- Firefox
- Flash
- Font
- Fonts
- Freeware
- ftp-deploy
- Gallery
- Games
- Grundlinienraster
- grunt
- Hardware
- Hosting
- House
- HTML5
- IE6
- IE7
- IE8
- IE9
- IE10
- IE11IE6
- iFrame
- iMovie
- InDesign
- Internet
- iOS
- iPad
- iTunes
- Kroatien
- Kultur
- Layout
- Live
- login
- lokaler
- Lüfter
- Mac
- MacBook
- Mac Book
- Mamp
- Maps
- Mash
- Mavericks
- Metamodels
- Mischpult
- Mixer
- mobiler
- Modul
- Mukke
- Music
- Native Instruments
- Netzwerk
- no
- OS X
- OSX
- page speed
- PC
- Pfronten
- Photo
- php
- Player
- Preview
- Publisher
- Quark
- Quark XPress
- Raster
- Reisen
- Router
- safari
- Schlüsselbund
- schneiden
- Schriften
- Script
- SEO
- Server
- Set
- Shell Script
- Slider
- Smartwatch
- Snow Board
- Software
- Soundkarte
- SSD
- syncen
- Synology
- Techno
- Terminal
- thunderbolt
- Time Mashine
- Traktor
- Trimm
- Tweets
- Typografie
- typografisches Raster
- typoman
- Unterstützung
- Up
- Video
- Web
- Webfont
- Webfonts
- Webserver
- Website
- Wifi
- Windows
- Wlan
- Xone
Kommentare