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

前端 未结 2 897
星月不相逢
星月不相逢 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: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,'');
            }
        });
        /* ******************** *************************************************/
    

提交回复
热议问题