首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grunt html livereload

Grunt html livereload
EN

Stack Overflow用户
提问于 2014-08-30 20:31:50
回答 1查看 46关注 0票数 0

我使用的是一个超级简单的grunt文件,它监视并编译我的sass文件,然后使用chrome扩展加载页面。

这一切都工作得很好,但我也想在进行更改和保存时观察html文件和liverload中的更改。

有人能告诉我为什么这个不起作用吗?

代码语言:javascript
复制
  module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);

    // Project configuration.
    grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),

      // Sass processing

      sass: {
        dist: {
          files: {
            "css/styles.css": "css/scss/styles.scss"
          }
        }
      },

      // Growl notifications
      notify: {
        full: {
          options: {
            message: 'Project compiled'
          }
        },
        sass: {
          options: {
            message: 'Sass compiled'
          }
        },
        html: {
          options: {
            message: 'html updated'
          }
        }
      },

      // File Watcher
      watch: {
        sass: {
          files: ['css/scss/*.scss'],
          tasks: ['sass', 'notify:sass'],
          options:{
            livereload: true
          }
        },

        html: {
          files: ['index.html','**/*.html','**/*.css'],
          tasks: ['notify:html'],
          options:{
            livereload: true
          }
        }
      }

    });


    // Default task(s).
    grunt.registerTask('default', ['watch']);

  };
EN

回答 1

Stack Overflow用户

发布于 2014-08-30 23:27:02

解决了这个问题。html手表应该在sass手表之前出现。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25582392

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档