How to get it to work with Gulp and Ripple Emulator?

I've tried various options and finally ended up with the following confusing version of gulpfile.js, but I just can't get it to work :(.

I am using npm package emulation instead of Chrome plugin. This will start the emulator and everything works except for the liver load (manual update works though).

var gulp = require('gulp');
var path = require('path');
var o = require('open');
var ripple = require('ripple-emulator');
var connect = require('gulp-connect');
var injectReload = require('gulp-inject-reload');
var webPath = function(p) {
  return path.join('./www/', p);
};

gulp.task('connect', function() {
  connect.server({
      root: 'www',
      livereload: true
  });
});

gulp.task('html', function() {
  gulp.src('./www/*.html')
    .pipe(injectReload({
        host: 'http://localhost'
    }))
    .pipe(gulp.dest(webPath('build')))
    .pipe(connect.reload());
});

gulp.task('watch', function() {
  gulp.watch(['./www/*.html'], ['html']);
});

// The default task
gulp.task('default', ['connect', 'watch'], function() {

  var options = {
    keepAlive: false,
    open: true,
    port: 4400
  };

  // Start the ripple server
  ripple.emulate.start(options);

  if (options.open) {
    o('http://localhost:' + options.port + '?enableripple=true');
  }
});

      

The dependencies I am using.

// package.json

{
  "name": "servicepromobile",
  "version": "0.0.0",
  "dependencies": {},
  "devDependencies": {
    "gulp": "latest",
    "open": "latest",
    "ripple-emulator": "latest",
    "gulp-livereload": "^2.1.1",
    "connect-livereload": "^0.5.0",
    "tiny-lr": "^0.1.4",
    "gulp-connect": "^2.0.6",
    "gulp-inject-reload": "0.0.2"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "grunt test"
  }
}

      

+3
android cordova gulp ripple gulp-livereload


source to share


No one has answered this question yet

Check out similar questions:

3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
1188
How do I get the build / version number of your Android app?
960
How to rotate the screen of Android emulator?
7
How do I combine gulp-watch and gulp-injection?
3
Gulp-ruby-sass Error:
3
You need to run gulp multiple times to get style changes
2
Gulp-sass will not compile scss files to css, but copy all files from scss folder to css folder
1
Gulp + Browserify link dependency
1
Gulp-livereload, -webserver and -embedlr. How do you use them together?
0
Accessing the base home directory in Gulp



All Articles
Loading...
X
Show
Funny
Dev
Pics