我正试着在手表上使用livereload。我一直收到消息“致命错误:端口35279已被另一个进程使用”。我已经更改了livereload的端口,但是没有重新加载。
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
cssDir: 'stylesheets',
sassDir: 'stylesheets/sass/',
imagesDir: 'images',
javascriptsDir: 'scripts',
require: ['sass-globbing','modular-scale'],
force: true
}
}
},
cssmin: {
minify: {
expand: true,
cwd: 'stylesheets',
src: ['*.css', '!*.min.css'],
dest: 'stylesheets',
ext: '.min.css'
}
},
watch: {
options: {
livereload: true
},
sass: {
files: 'stylesheets/sass/*.scss',
tasks: ['compass']
},
css: {
files: 'stylesheets/*.css',
tasks: ['cssmin']
},
html: {
files: ['index.html','**/*.css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default',['compass','watch']);}
发布于 2014-01-04 04:31:07
添加
<script src="//localhost:1337/livereload.js"></script>到您想要加载livereload的页面。1337是您在grunt文件中设置的端口。
options: {
livereload: 1337
},发布于 2014-02-01 16:07:51
您可以在bash/终端窗口中手动关闭livereload服务器,如下所示:
curl localhost:35279/kill更多信息请点击此处:https://github.com/mklabs/tiny-lr
发布于 2013-10-30 06:03:05
你在使用Sublime Text和LiveReload包吗?已知这是导致此问题的原因。如果是,请在Sublime Text中禁用或卸载该软件包。
https://stackoverflow.com/questions/19268136
复制相似问题