I
I
Ilya2013-12-17 22:15:26
HTML
Ilya, 2013-12-17 22:15:26

How to avoid crash when compiling jade to html?

I'm using the default jade compiler from npm.
I do something like jade -w index.jade
For every syntax or other error, the process (watch) in the console stops and I have to restart everything again, unlike stylus, which does not interrupt the watch process. How can this be avoided?
PS I put a compilation task on grunt, but as always, compilation slows down there, although nothing crashes.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Alyoshin, 2016-02-03
@mrwoo

Like this

// JADE
function log(error) {
    console.log([
        '',
        "----------ERROR MESSAGE START----------",
        ("[" + error.name + " in " + error.plugin + "]"),
        error.message,
        "----------ERROR MESSAGE END----------",
        ''
    ].join('\n'));
    this.end();
}

gulp.task('jade', function() {
    return gulp.src(paths.src.jade)
        .pipe(jade({
              pretty: true,
            })).on('error', log)
        .pipe(gulp.dest('src/'))
        .pipe(reload({
            stream: true
        }));
});

K
Konstantin Velichko, 2014-03-19
@Zoxon

Try gulp, nothing slows down there, and it just prints an error .on('error', console.log).

gulp.task('jade', function() {
  gulp.src(['./source/**/*.jade', '!./source/partials/*.jade'])
    .pipe(jade({
      pretty: true
    }))
    .on('error', console.log)

  .pipe(prettify({
    indent_char: '	',
    indent_size: 1,
    indent_with_tabs: true
  }))
    .pipe(gulp.dest('./public/'))
    .pipe(livereload(server));
});

I can share the project

O
OnYourLips, 2013-12-17
@OnYourLips

I would use the IDE's tools to track changes.

V
Vsevolod Rodionov, 2013-12-19
@Jabher

maybe forever will help?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question