Skip to content

Commit

Permalink
Версия 2.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreysgra committed Jun 27, 2019
1 parent c86bccc commit d149ff4
Show file tree
Hide file tree
Showing 13 changed files with 568 additions and 708 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 d149ff4

Please sign in to comment.