F
F
Froggyweb2017-04-25 16:37:25
css
Froggyweb, 2017-04-25 16:37:25

Gulp 4 + browserify + error Watcher crashes on js error?

galp settings:

'use strict';

//TODO https://github.com/mrmlnc/emitty - optimize pug

const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const browserSync = require('browser-sync').create();

const gutil = require('gulp-util');
const browserify = require('browserify');
const watchify = require('watchify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');


const copyDir = 'front/fonts/**/*.*';
const assets = 'assets/';

gulp.task('javascript', function () {
  // set up the browserify instance on a task basis
  var b = browserify({
    entries: './front/js/app.js',
    debug: false
  });

  return b.bundle()
    .pipe(plumber())
    .pipe(source('bundle.js'))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps: true}))
        // Add transformation tasks to the pipeline here.
        // .pipe(uglify())
        .on('error', gutil.log)
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('public/' + assets + 'js'));
});



gulp.task('watch', function() {
  gulp.watch('front/js/**/*.js', gulp.series('javascript'));
});

gulp.task('default',
    gulp.series('build', gulp.parallel('watch', 'serve'))
);

in console like this
[16:28:00] 'javascript' errored after 788 ms
[16:28:00] Error: Cannot find module './scripts/imp.js' from 'D:\_styl-start\front\js '
at D:\_styl-start\node_modules\browser-resolve\node_modules\resolve\lib\async.js:55:21
at load (D:\_styl-start\node_modules\browser-resolve\node_modules\resolve\lib\ async.js:69:43)
at onex (D:\_styl-start\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
at D:\_styl-start\node_modules\browser- resolve\node_modules\resolve\lib\async.js:22:47
at FSReqWrap.oncomplete (fs.js:123:15)
[16:28:00] 'watch' errored after 25 s
[16:28:00] ' default' errored after 31 s
[16:28:00] The following tasks did not complete:serve
[16:28:00] Did you forget to signal async completion?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2018-05-21
@Ankhena

ionden.com/a/plugins/ion.rangeSlider

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question