使用Gruntjs的源文件的Livereload
我无法进行实时重新加载运行。Grunt没有报告任何问题。web模型正在MAMP端口8888上运行,不确定此信息对于解决此问题是否重要 CSS资源根本没有加载使用Gruntjs的源文件的Livereload,gruntjs,less,grunt-contrib-watch,Gruntjs,Less,Grunt Contrib Watch,我无法进行实时重新加载运行。Grunt没有报告任何问题。web模型正在MAMP端口8888上运行,不确定此信息对于解决此问题是否重要 CSS资源根本没有加载 <link rel="stylesheet" href="//localhost:1111/style/style.css"> 如何检查重新加载服务是否正常运行 你能帮我吗? 谢谢,我找到了解决办法。我下载了ChromeLivereLoad扩展,现在一切正常。GrunFile.js如下所示: module.exports =
<link rel="stylesheet" href="//localhost:1111/style/style.css">
如何检查重新加载服务是否正常运行
你能帮我吗?
谢谢,我找到了解决办法。我下载了ChromeLivereLoad扩展,现在一切正常。GrunFile.js如下所示:
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
options: {
paths: ["style"],
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"style/style.css": "source/style/style.less"
}
}
},
watch: {
less: {
files: "source/style/*",
tasks: ["less"],
options: {
nospawn: true
}
},
css: {
files: ['style/style.css'],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
};
你为什么看css?您可能还想将您的监视任务更新到['less:development'],您是否在文件中添加了一个?虽然我不确定它是否应该与MAMP服务器一起工作。我让它工作起来,看看我的答案,但是它并不总是重新加载页面。我快发疯了
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
options: {
paths: ["style"],
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"style/style.css": "source/style/style.less"
}
}
},
watch: {
less: {
files: "source/style/*",
tasks: ["less"],
options: {
nospawn: true
}
},
css: {
files: ['style/style.css'],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
};