How to find the error?

The project has several js files. They contain a set of scripts. They then compressed using gulp+webpack and connect to the project as one already inficirovannye script.

The result is that if any of the script error in the console indicates that the error in the compressed file. How to be in this situation to find out exactly where the error is, not just to obtain a link to the shared file?
April 3rd 20 at 18:40
2 answers
April 3rd 20 at 18:42
Solution
know exactly where the error is, not just to obtain a link to the shared file?


Use the plugin sourcemaps (a plugin for gulp)
1) Before processing the file, specify a command .pipe(sourcemaps.init())
2) After processing the file is specified: .pipe(sourcemaps.write())
All this is explained in the documentation.

Turns out this code in the Gulp file
const gulp = require('gulp');
const concat = require('gulp-concat');
const sourcemaps = require('gulp-sourcemaps');

gulp.task('js', function() {
 return gulp.src('js/*.js')

 // Initiate the map before working with the file
.pipe(sourcemaps.init())

 // Combine all JS into one file
.pipe(concat('main.js'))

 // Write a map of all source files
.pipe(sourcemaps.write())

.pipe(gulp.dest('./'));
})


In the end, the console does not mention the final file and the original

5dfb5501d1044079730414.png
April 3rd 20 at 18:44
gulp+webpack configure soucemaps or/and so dev did not benificial files

Find more questions by tags LayoutWeb DevelopmentGulp.jsWebpack