0
我在开发过程中打开了2个选项卡(其中一个应用程序,另一个使用jasmine
测试套件)。因此,我有2个browserify捆绑包(这似乎是this code),所以,我需要两个gulp-livereload
实例工作。这是我该怎么办:在gulp上运行两个livereload实例
var livereloadTestSuite = require('gulp-livereload');
var livereloadDeveloperSuite = require('gulp-livereload'); // port 35728
appBundler.bundle()
.on('error', gutil.log)
.pipe(source('application.js'))
.pipe(gulpif(!options.development, streamify(uglify())))
.pipe(gulp.dest(options.dest))
.pipe(gulpif(options.development, livereloadDeveloperSuite())) // this line
.pipe(notify(function() {
console.log('APP bundle built in ' + (Date.now() - start) + 'ms');
}));
testBundler.bundle()
.on('error', gutil.log)
.pipe(source('specs.js'))
.pipe(gulp.dest('./build/'))
.pipe(livereloadTestSuite())
.pipe(notify(function() {
console.log('TEST bundle built in ' + (Date.now() - start) + 'ms');
}));
gulp.task('default', ['buildDependencies'], function() {
livereloadTestSuite.listen();
livereloadDeveloperSuite.listen({ port: 35728, host: 'localhost' });
// calling bundler & testBundler methods
而且茉莉测试套件具有行
<script src="http://localhost:35729/livereload.js?snipver=1"></script>
而且应用测试套件具有此行
<script src="http://localhost:35728/livereload.js?snipver=1"></script>
茉莉花测试套件重装成功在它的重新绑定,但开发套件根本不会重新加载。我不知道如何解决这个问题