S
S
St-Permiakov2018-02-14 11:36:40
Building projects
St-Permiakov, 2018-02-14 11:36:40

How to check files before concatenation (gulp file-include)?

frontend. Building the project via file-include.
The plugin is integrated deep into projects (using if_else, file connection order, etc.)
Question: is it possible to validate js files before concatenation so that it is clear which file has an error?
Now I'm getting a plan error

/build/js/main.js: Unexpected token, expected , (1632:128)

And guessing which file line 1632 corresponds to is very difficult.
Is it possible to somehow catch the error in the source file before they are merged?
Now the js build task looks like this:
gulp.task('js:build', wrapPipe(function(success, error) {
    return gulp.src(path.src.js)
        .pipe(fileinclude())
        .pipe(babel({presets:  })).on('error', error)
        .pipe(uglify()).on('error', error)
        .pipe(rename('main.js'))
        .pipe(gulp.dest(path.build.js))
        .pipe(gulpif(sync, reload({stream: true})));
}));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-02-14
@sim3x

Generate .map for each such
jslint include - check syntax
Tests

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question