09 - Generating .map files and small intro about them - Gulp 4

preview_player
Показать описание
Gulpjs series where I go over the basic
content:
⦾ intro
⦾ gulp tasks ( series & parallel )
⦾ compiling SCSS
⦾ cleaning/minifying CSS
⦾ compiling JS
⦾ cleaning/minifying JS
⦾ File watchers
⦾ browsersync

slides:

repo:

docs:
gulp-sourcemaps:
Рекомендации по теме
Комментарии
Автор

I made a mistake which leads to creating files that are called for example `main.css.min.css` so change your `minifyCSS` to write the .map files right before righting into the dist folder like this


const minifyCSS = () =>
src(sync(join(path, 'dist', '**/!(*.min).css')))
.pipe(sourcemaps.init())
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(
rename(({ dirname, basename }) => ({
dirname,
basename: `${basename}.min`,
extname: '.css',
}))
)
.pipe(sourcemaps.write('.'))
.pipe(dest(join(path, 'dist')))


it's updated in the repo...

Rowadz