Skip to content

Commit

Permalink
chore: remove sourcemap from production build
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Feb 22, 2023
1 parent 15389c6 commit 8610880
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,31 @@ const icons = function () {


const styles = function () {
return gulp.src(paths.styles)
.pipe(gulpSass())
.pipe(gulpSourcemaps.init())
let stylesPipe = gulp.src(paths.styles)
.pipe(gulpSass());

if (process.env.ENV !== 'production') {
stylesPipe = stylesPipe.pipe(gulpSourcemaps.init());
}

stylesPipe = stylesPipe
.pipe(gulpAutoprefixer(['last 1 version', '> 1%', 'ff >= 20', 'ie >= 9', 'opera >= 12', 'Android >= 2.2'], {cascade: true}))
.pipe(gulpHeader(banner, {pkg: pkg, description: 'Default stylesheet for Trumbowyg editor'}))
.pipe(gulp.dest('dist/ui/'))
.pipe(gulpSize({title: 'trumbowyg.css'}))
.pipe(gulpRename({suffix: '.min'}))
.pipe(gulpCleanCss())
.pipe(gulpHeader(bannerLight, {pkg: pkg}))
.pipe(gulpSourcemaps.write('.'))
.pipe(gulpHeader(bannerLight, {pkg: pkg}));

if (process.env.ENV !== 'production') {
stylesPipe = stylesPipe.pipe(gulpSourcemaps.write('.'));
}

stylesPipe = stylesPipe
.pipe(gulp.dest('dist/ui/'))
.pipe(gulpSize({title: 'trumbowyg.min.css'}));

return stylesPipe;
};

const sassDist = gulp.series(styles, function sassDist() {
Expand Down

0 comments on commit 8610880

Please sign in to comment.