Stylesheet not loaded because of MIME-type

前端 未结 30 2527
猫巷女王i
猫巷女王i 2020-11-22 07:29

I\'m working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes.

The gulp task compiles everything

30条回答
  •  醉酒成梦
    2020-11-22 08:03

    Comments in your file will trip this. Some minifiers will not remove comments.

    ALSO

    If you use Node.js and set your static files using express such as:

    app.use(express.static(__dirname + '/public'));
    

    You need to properly address the files.

    In my case both were the issue, so I prefixed my CSS links with "/css/styles.css".

    Example:

    
                    
                    0
                  
                       
                    
                   讨论(0)
                  
                                                      
                  
                  
提交回复
热议问题