Skip to content

Commit

Permalink
Merge pull request #6 from andreysgra/update
Browse files Browse the repository at this point in the history
Версия 3.2
  • Loading branch information
andreysgra authored Jun 27, 2019
2 parents 37946ac + 0bbefb8 commit e1090e1
Show file tree
Hide file tree
Showing 4 changed files with 4,044 additions and 6,075 deletions.
7 changes: 2 additions & 5 deletions gulpfile.js/tasks/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ const { task, src, dest } = require('gulp');
const gulpIf = require('gulp-if');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');

const isDev = !process.env.NODE_ENV;

// Минификация JS файлов
task('scripts', () =>
src(`${settings.paths.src.scripts}**/*.js`)
.pipe(gulpIf(isDev, sourcemaps.init()))
src(`${settings.paths.src.scripts}**/*.js`, { sourcemaps: true })
.pipe(babel())
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulpIf(isDev, sourcemaps.write()))
.pipe(rename({ suffix: '.min' }))
.pipe(dest(settings.paths.dest.scripts))
.pipe(gulpIf(isDev, dest(settings.paths.dest.scripts, { sourcemaps: true }), dest(settings.paths.dest.scripts)))
);
7 changes: 2 additions & 5 deletions gulpfile.js/tasks/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { task, src, dest } = require('gulp');
const gulpIf = require('gulp-if');
const plumber = require('gulp-plumber');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const less = require('gulp-less');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
Expand All @@ -18,14 +17,12 @@ const isDev = !process.env.NODE_ENV;
task('styles', () => {
let pluginsPostcss = [autoprefixer()];

return src(`${settings.paths.src.styles}style.less`)
.pipe(gulpIf(isDev, sourcemaps.init()))
return src(`${settings.paths.src.styles}style.less`, { sourcemaps: true })
.pipe(plumber())
.pipe(less())
.pipe(postcss(pluginsPostcss))
.pipe(csso({ forceMediaMerge: true, comments: false }))
.pipe(gulpIf(isDev, sourcemaps.write()))
.pipe(rename({ suffix: '.min' }))
.pipe(dest(settings.paths.dest.styles))
.pipe(gulpIf(isDev, dest(settings.paths.dest.styles, { sourcemaps: true }), dest(settings.paths.dest.styles)))
.pipe(gulpIf(isDev, browserSync.stream()));
});
Loading

0 comments on commit e1090e1

Please sign in to comment.