【发布时间】:2015-03-14 14:13:05
【问题描述】:
我遵循了这个教程: http://www.gilluminate.com/2014/06/10/livereload-ssl-https-grunt-watch/
我的 Gruntfile.js 看起来像这样:
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: {
globals: {
jQuery: true
}
}
},
watch: {
css: {
files: '**/*.sass',
tasks: ['sass'],
options: {
livereload: {
port: 9000,
key: grunt.file.read('ssl/livereload.key'),
cert: grunt.file.read('ssl/livereload.crt')
// you can pass in any other options you'd like to the https server, as listed here: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jshint']);
};
我加了
<script src="//localhost:9000/livereload.js"></script>
在我的 index.html 文件的末尾。
我的目标是通过 httpS 运行 livereload:端口 9000。 也许我错过了某些部分,例如“运行 Grunt 以使其加载到 grunt 文件”?
我得到的错误是:
GET https://localhost:9000/livereload.jsnet::ERR_CONNECTION_REFUSED
【问题讨论】:
-
您找到问题的答案了吗?
-
没有#maddog。不幸的是,我没有。一段时间后,我出于其他原因转移到另一个项目
-
感谢您回来:)