代码之家  ›  专栏  ›  技术社区  ›  BBaysinger alex

grunt contrib connect/grunt contrib watch livereload:拒绝从[path]应用样式,因为它的MIME类型

  •  1
  • BBaysinger alex  · 技术社区  · 6 年前

    我使用grunt contrib connect和grunt contrib watch来实现实时重新加载功能,如下所示:

    watch: {
      options: {
        livereload: true,
      },
      files: ['src/**/*'],
      tasks: ['dev']
    },
    connect: {
      server: {
        options: {
          port: 8000,
          base: './dist',
          hostname: '0.0.0.0',
          protocol: 'http',
          livereload: true,
          open: true,
        }
      }
    },
    

    Refused to apply style from 'http://localhost:8000/section-featured-work/mod-mobile-design.css?livereload=1533148529995' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
    

    有没有办法为加载CSS文件的脚本指定MIME类型?

    我不相信这是 stackoverflow.com/questions/48248832/ ,我相信这是

    0 回复  |  直到 6 年前