Skip to content

Commit

Permalink
Merge pull request #14 from andreysgra/dev
Browse files Browse the repository at this point in the history
Версия 5.0.0
  • Loading branch information
andreysgra authored Oct 20, 2020
2 parents 7d1d500 + 0ba7dd5 commit 1a156d1
Show file tree
Hide file tree
Showing 17 changed files with 3,929 additions and 1,714 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Базовый шаблон проекта со сборкой на Gulp с использованием Less
# Базовый шаблон проекта с использованием Gulp, Less, Webpack

[![Build status][travis-image]][travis-url] [![Dependency status][dependency-image]][dependency-url]

Expand Down Expand Up @@ -47,7 +47,6 @@ cd project-name
│ ├── js/ # каталог JS файлов
│ ├── styles/ # каталог файлов стилей
│ └── index.html # файл разметки страницы
├── .babelrc # файл конфигурации Babel
├── .editorconfig # файл конфигурации настроек редактора
├── .eslintrc.json # файл конфигурации ESLint
├── .gitattributes # файл атрибутов Git
Expand All @@ -57,7 +56,8 @@ cd project-name
├── .travis.yml # файл конфигурации Travis CI
├── package.json # файл npm зависимостей и настроек проекта
├── package-lock.json # lock-файл npm
└── README.md # документация проекта
├── README.md # документация проекта
└── webpack.config.js # файл конфигурации Webpack
```

[travis-image]: https://travis-ci.org/andreysgra/gulp-project-template.svg?branch=master
Expand Down
8 changes: 4 additions & 4 deletions gulpfile.js/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

const dir = require('require-dir')('./tasks');
const { clean, fonts, copy, pages, styles, scripts, images, webp, icons } = dir;
const { zip, server, watcher, lintspaces } = dir;
const tasks = require('require-dir')('./tasks');
const { clean, fonts, pages, styles, scripts, images, webp, icons } = tasks;
const { zip, server, watcher, lintspaces } = tasks;

const { series, parallel } = require('gulp');

const build = series(
clean,
parallel(fonts, copy, pages, styles, scripts, images, webp, icons)
parallel(fonts, pages, styles, scripts, images, webp, icons)
);

exports.zip = series(zip);
Expand Down
7 changes: 0 additions & 7 deletions gulpfile.js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,5 @@ module.exports = {
fonts: dirs.dest + 'fonts/'
},
dist: './dist'
},
vendor: {
scripts: [
'./node_modules/picturefill/dist/picturefill.min.js',
'./node_modules/svg4everybody/dist/svg4everybody.min.js',
'./node_modules/@babel/polyfill/dist/polyfill.min.js'
]
}
};
11 changes: 0 additions & 11 deletions gulpfile.js/tasks/copy.js

This file was deleted.

2 changes: 1 addition & 1 deletion gulpfile.js/tasks/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const gulpIf = require('gulp-if');
const imagemin = require('gulp-imagemin');
const svgstore = require('gulp-svgstore');

const isProd = !!process.env.NODE_ENV;
const isProd = Boolean(process.env.NODE_ENV);

// Сборка SVG спрайта
const icons = () => {
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js/tasks/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const changed = require('gulp-changed');
const imagemin = require('gulp-imagemin');
const imageminJpegoptim = require('imagemin-jpegoptim');

const isProd = !!process.env.NODE_ENV;
const isProd = Boolean(process.env.NODE_ENV);

// Оптимизация изображений
const images = () => {
Expand Down
19 changes: 6 additions & 13 deletions gulpfile.js/tasks/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@

const { paths: { source, desination } } = require('../settings');
const { src, dest } = require('gulp');
const gulpIf = require('gulp-if');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');

const isDev = !process.env.NODE_ENV;
const config = require('../../webpack.config.js');
const stream = require('webpack-stream');
const webpack = require('webpack');

// Минификация JS файлов
const scripts = () =>
src(`${source.scripts}**/*.js`, { sourcemaps: true })
.pipe(babel())
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulpIf(isDev, dest(desination.scripts, { sourcemaps: true }), dest(desination.scripts)));
src(`${source.scripts}**/*.js`)
.pipe(stream(config, webpack))
.pipe(dest(desination.scripts));

module.exports = scripts;
Loading

0 comments on commit 1a156d1

Please sign in to comment.