spider icon indicating copy to clipboard operation
spider copied to clipboard

watch parameter when compiling to javascript

Open oxysoft opened this issue 11 years ago • 3 comments

Coffeescript lets you add a 'watch' parameter so you can do something like -wc and it keeps recompiling the coffeescript scripts to javascript whenever changes are applied to them. This would be nice to have with Spider

oxysoft avatar Dec 02 '14 00:12 oxysoft

I think that shouldn't be built-in into compiler. Compiler is compiler. Watcher is watcher. It's pretty easy to watch files using gulp.js or even Grunt.

@oxysoft have you seen gulp.js?

var gulp = require('gulp'),
    watch = require('gulp-watch'),
    spider = require('gulp-spider-script');

var Path = {
  spiderSrc: 'src/*.spider,
  spiderDest: 'out/js'
};

gulp.task('watch', function() {
  return gulp.src(Path.spiderSrc)
    .pipe(watch({glob: Path.spiderSrc}))
    .pipe(spider())
    .pipe(gulp.dest(Path.spiderDest))
});

Namek avatar Dec 03 '14 13:12 Namek

Hi, I tried your suggestion and it would appear to have worked but gulp-spider-script only supports version 0.0.4 of Spider and changing it to the latest version will not work. Perhaps if the author updated it? This is my first time using gulp so there is no way I can update it myself.

oxysoft avatar Dec 05 '14 03:12 oxysoft

I think this definitely should be put into the compiler. There's no reason I should have to pull in Grunt or Gulp just to accomplish a simple task. Grunt/Gulp is designed for making complicated actions easier without using make, not for providing basic, useful functionality.

zekesonxx avatar Dec 05 '14 21:12 zekesonxx