Skip to content

Doesn't work with gulp.watch() out of the box #10

@faridnsh

Description

@faridnsh

Here's what I tried:

gulp.task('build:lbServices', function() {
    return gulp.src(sources.server)
      .pipe(loopbackAngular())
      .pipe(rename('lb-services.js'))
      .pipe(gulp.dest('./client/js/services'));
});

gulp.task('dev', ['build'], function() {

  // watch for js changes
  gulp.watch(sources.serverJs, ['build:lbServices']).on('change', function(event) {
    // Thought this will solve it, but it didn't
    delete require.cache[event.path];
    delete require.cache[path.resolve(sources.server)];
  });
});

One way to fix this, is to just use the lb-ng command instead(or spawn another process to do this), which will also solve #3 and #9.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions