Chrome's “Auto-Reload Generated CSS” not reloading page when SASS recompiles CSS

前端 未结 2 863
星月不相逢
星月不相逢 2021-02-04 11:04

I\'m trying to get Chrome\'s DevTools to auto reload a page when I save a watched SCSS file which will compile and make changes to the CSS file.

I have the Auto-reload g

相关标签:
2条回答
  • 2021-02-04 11:42

    I used drupal in this case and drupal generate css link like 'style.css?abc'. Problem in this suffix '?abc'. You need to start file mapping from LOCAL (press right-click on local) 'style.css' to WEB 'style.css?abc' (shown in list). Not from WEB to LOCAL. If result is correct WEB-links disappears from list in 'resourses' tab.

    0 讨论(0)
  • 2021-02-04 11:51

    here is a good solution, to avoid this mapping issue of .css?201203241721 / .js?201203241721-files as szdv mentioned with drupal. I have had it with typo3 and this solved it:

        /* remove in production *************************************************/
        //filter typo3 temp file src/href with ?date ending for chrome workspaces
        $('script, link').each(function(){
            rpString = /\?[0-9]*/;
            if(this.src){
                this.src = this.src.replace(rpString,'');
            }
            if(this.href){
                this.href = this.href.replace(rpString,'');
            }
        });
        /* ******************** *************************************************/
    
    0 讨论(0)
提交回复
热议问题