我正在尝试将 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']);
}