我正在尝试使用docker和我正在研究的node.js网络应用程序.
我熟悉了docker概念,并在这里得到了运行示例:https://docs.docker.com/examples/nodejs_web_app/
我得到了一般过程...写一个Dockerfile - >构建一个docker镜像 - >在VM中运行它.
但是,每次更改文件时重建映像并重新启动容器似乎都是不切实际的.
我目前有一个gulp/live-reload设置非常适合开发,所以我想知道是否有任何推荐的方法用docker完成这样的事情.
谢谢!
我是第一次尝试Yeoman Server,看到它提供了一个原生的手表工具作为LiveReload的后备.以下是文档解释回退的方法:
"[Yeoman Server]会自动启动该yeoman watch过程,因此对任何应用程序文件的更改都会导致浏览器通过LiveReload进行刷新.如果您没有在本地安装LiveReload,则会使用后备重新加载过程."
到目前为止,回退过程工作正常,我喜欢它不需要在浏览器/菜单栏中安装任何东西.
有没有人和Yeoman一起试过两种手表工具?如果您"升级"到LiveReload,工作流程有何不同以及您会获得哪些附加功能?
更新:对API的快速检查显示,Yeoman的实时重新加载功能实际上是LiveReload.他们是同一个人.它没有浏览器扩展的原因是因为他们使用的是LiveReload的snipvr代码片段.有可能通过LiveReload GUI可以访问一些其他功能,也许可以用于移动设备测试,但功能更可能是相同的.
我一直在使用livereload chrome扩展,它将http:// [...] /livereload.js插入到文档中.不幸的是,我正在开发一个需要https的项目,我希望能在本地复制,但我没有必要这样做,因为我可以为不同的环境更改协议,但我想知道是否可以设置gulp -livereload通过https加载?
我尝试了一些事情,比如手动添加脚本没有成功,因为我收到连接错误(GET https://127.0.0.1:35729/livereload.js?snipver=1 net :: ERR_CONNECTION_CLOSED):
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://127.0.0.1:35729/livereload.js?snipver=1';
document.getElementsByTagName('body')[0].appendChild(script)
Run Code Online (Sandbox Code Playgroud)
任何提示都表示赞赏,谢谢!
使用--live-reload参数时,我无法在手机上看到我的离子应用程序.
我使用的是Windows 8.1和连接的Nexus 5 Android设备.该应用程序是使用创建的示例sidemenu应用程序ionic start demo sidemenu.
当我运行时ionic run --live-reload,我首先通过可能的IP地址列表呈现:
Multiple addresses available.
Please select which address to use by entering its number from the list below:
Note that the emulator/device must be able to access the given IP address
1) 192.168.0.109 (Wi-Fi)
2) 192.168.159.1 (VMware Network Adapter VMnet1)
3) 192.168.174.1 (VMware Network Adapter VMnet8)
4) 192.168.56.1 (VirtualBox Host-Only Network)
Run Code Online (Sandbox Code Playgroud)
我选择选项1 - 这是我的开发PC的IP地址,即托管离子服务器.
Ionic确认此选择,并确认它正在为端口提供服务,如下所示:
Selected address: 192.168.0.109
Running live reload server: …Run Code Online (Sandbox Code Playgroud) 在Asp.Net 5中,开发速度更快,因为它在保存时编译.但我仍然需要手动刷新浏览器.
Visual Studio中是否有实时重新加载选项,还是应该使用gulp插件?
asp.net livereload asp.net-core-mvc visual-studio-2015 asp.net-core
我正在努力让Grunt的"实时重新加载"能力(如实现grunt-contrib-watch)在我的应用程序中工作.我终于咬紧牙关,试着做一个最小的例子.希望有人可以很容易地注意到缺少的东西.
文件结构:
??? Gruntfile.js
??? package.json
??? index.html
Run Code Online (Sandbox Code Playgroud)
package.json
{
"name": "livereloadTest",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-watch": "~0.5.3"
}
}
Run Code Online (Sandbox Code Playgroud)
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
src: {
files: ['*.html'],
options: { livereload: true }
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
};
Run Code Online (Sandbox Code Playgroud)
index.html
<!doctype html>
<html>
<head><title>Test</title></head>
<body>
<p>....</p>
<script src="//localhost:35729/livereload.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
然后我跑了grunt watch,什么都没吹.但是,没有浏览器窗口自动打开(应该吗?).
当我在http://localhost:35729/我收到这个json 时打开chrome :
{"tinylr":"Welcome","version":"0.0.4"}
Run Code Online (Sandbox Code Playgroud)
并尝试在该端口上的任何其他路径给我
{"error":"not_found","reason":"no such route"}
Run Code Online (Sandbox Code Playgroud) 您可以在此处查看/克隆完整代码:https://github.com/mlewisTW/grunt-tests
我想观看的src目录(来缩小,CONCAT,少等),这使一切都入build目录.我也想观看的build目录,以livereload.这是手表配置代码段:
watch: {
options: {
livereload: false
},
build: {
files: ['<%= srcDir %>/**/*'],
tasks: 'build'
},
reload: {
files: ['<%= buildDir %>/**/*'],
options: {
livereload: true
}
}
},
Run Code Online (Sandbox Code Playgroud)
我在Windows 8上.Fatal error: watch EPERM当我更改文件时,我得到了一个,它开始了build任务的第一步(干净).我猜这与我正在尝试删除一个监视目录的事实有关.
有没有办法在我构建时关闭livereload watch任务,然后在完成后重新启动它?
还有其他/更好的方法吗?
我有我Gulpfile的编译我的sass,只是" live-reload远离倾销codekit".我正在努力让这种风格的注射工作.我试图设置它:https://github.com/vohof/gulp-livereload
当我在终端中运行gulp时,它似乎编译了sass,但它没有注入样式.我究竟做错了什么?我在chrome +以下节点模块中安装了livereload扩展:
"devDependencies": {
"gulp": "~3.5.0",
"gulp-sass": "~0.6.0"
},
"dependencies": {
"gulp-livereload": "~0.2.0",
"tiny-lr": "0.0.5"
}
Run Code Online (Sandbox Code Playgroud)
我的gulpfile看起来像这样:
var gulp = require('gulp');
//plugins
var sass = require('gulp-sass'),
lr = require('tiny-lr'),
livereload = require('gulp-livereload'),
server = lr();
gulp.task('sass', function () {
gulp.src('./scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('./'))
.pipe(livereload(server));
});
// Rerun tasks when a file changes
gulp.task('watch', function () {
server.listen(35729, function (err) {
if (err) return console.log(err);
gulp.watch('scss/**/*.scss', ['sass']);
});
});
// …Run Code Online (Sandbox Code Playgroud) 我在Mac上,只是使用npm安装了ember cli,我认为它可以开箱即用.这是服务器输出:
version: 0.1.4
Could not find watchman, falling back to NodeWatcher for file system events
Livereload server on port 35729
Serving on http://0.0.0.0:4200/
Build successful - 2456ms.
Slowest Trees | Total
-------------------------------+----------------
EsnextFilter | 877ms
TreeMerger | 380ms
Concat | 375ms
JSHint - Tests | 178ms
EsnextFilter | 146ms
ES6Concatenator | 135ms
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Gulp,Sublime Text 3和Chrome使用Livereload,但由于某种原因它不起作用.这就是我做的.
我在这里错过了什么?我是否需要为Sublime Text 3安装Livereload插件?
仅供参考 - Chrome中Livereload扩展程序中的"选项"按钮显示为灰色.
我的Gulpfile:
var gulp = require('gulp');?
var scssPlugin = require('gulp-sass');
var livereload = require('gulp-livereload');
gulp.task('myStyles', function () {
gulp.src('sass/*.scss')
.pipe(scssPlugin())
.pipe(gulp.dest('css'))
.pipe(livereload());
});
gulp.task('watchMyStyles', function() {
livereload.listen();
gulp.watch('sass/*.scss', ['myStyles']);
});
gulp.task('default', ['watchMyStyles']);
Run Code Online (Sandbox Code Playgroud)
包文件:
{
"devDependencies": {
"gulp": "^3.9.0",
"gulp-livereload": "^3.8.0",
"gulp-sass": "^2.0.4"
}
}
Run Code Online (Sandbox Code Playgroud) livereload ×10
gulp ×4
gruntjs ×3
javascript ×2
node.js ×2
asp.net ×1
asp.net-core ×1
cordova ×1
docker ×1
ember-cli ×1
ember.js ×1
gulp-sass ×1
gulp-watch ×1
ionic ×1
sass ×1
yeoman ×1