gpt4 book ai didi

javascript - Grunt 不再实时重载

转载 作者:行者123 更新时间:2023-11-28 01:37:07 24 4
gpt4 key购买 nike

我是网络开发新手,我正在尝试构建一个小型网络应用程序。我使用 yoeman 来设置一切,它做得很好, Angular 安装完美,我在使用 Bower 之后安装了 Angular-animate 和 jquery-ui。自动重新加载网页会自动发生,我真的很喜欢它。

过了一会儿,它停止了实时重新加载我的更改。我不知道为什么。我不确定我做了什么。

这就是我的 gruntfile 监视部分的样子:

    // Watches files for changes and runs tasks based on the changed files
watch: {
js: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['newer:jshint:all'],
options: {
livereload: true
}
},
jsTest: {
files: ['test/spec/{,*/}*.js'],
tasks: ['newer:jshint:test', 'karma']
},
styles: {
files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['newer:copy:styles', 'autoprefixer']
},
gruntfile: {
files: ['Gruntfile.js']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= yeoman.app %>/{,*/}*.html',
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
}

看起来不错吧?运行时没有出现错误:

grunt serve

最佳答案

我遇到了同样的问题,LiveReload 一段时间后就会停止工作。

对我有用的是重新安装 LiveReload Chrome 扩展,因此如果您没有对 Gruntfile 进行任何更改,您可以尝试一下。

关于javascript - Grunt 不再实时重载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21408426/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com