Add sourcemaps support to Gulp (#4089)

fixes https://github.com/cookiecutter/cookiecutter-django/issues/4045
This commit is contained in:
Pamela Fox 2023-01-19 14:45:56 -08:00 committed by GitHub
parent 23b41967a8
commit be8aa5c73d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -346,4 +346,5 @@ project.css
project.min.css project.min.css
vendors.js vendors.js
*.min.js *.min.js
*.min.js.map
{%- endif %} {%- endif %}

View File

@ -85,13 +85,13 @@ function scripts() {
// Vendor Javascript minification // Vendor Javascript minification
function vendorScripts() { function vendorScripts() {
return src(paths.vendorsJs) return src(paths.vendorsJs, { sourcemaps: true })
.pipe(concat('vendors.js')) .pipe(concat('vendors.js'))
.pipe(dest(paths.js)) .pipe(dest(paths.js))
.pipe(plumber()) // Checks for errors .pipe(plumber()) // Checks for errors
.pipe(uglify()) // Minifies the js .pipe(uglify()) // Minifies the js
.pipe(rename({ suffix: '.min' })) .pipe(rename({ suffix: '.min' }))
.pipe(dest(paths.js)) .pipe(dest(paths.js, { sourcemaps: '.' }))
} }
// Image compression // Image compression