Gulp 4 не создает sourcemaps для js

Gulp 4 выполняет функцию но sourcemaps для js файлов не создается

Код:

function scripts() {
    return src([ 
        themePath + '/inc/js/template.js'
    ], {sourcemaps: true})
        .pipe(concat('template.min.js'))
        .pipe(uglify()) 
        .pipe(dest(themePath + '/inc/js', {sourcemaps: '.'}));
}

Ответы (1 шт):

Автор решения: Vadizar

Установите зависимость gulp-sourcemaps и подключите её в gulpfile.js. А потом:

function scripts() {
    return src([ 
        themePath + '/inc/js/template.js'
    ])
        .pipe(sourcemaps.init())
        .pipe(concat('template.min.js'))
        .pipe(uglify()) 
        .pipe(sourcemaps.write())
        .pipe(dest(themePath + '/inc/js'));
}
→ Ссылка