Skip to content

Commit

Permalink
Upgrade to gulp 4 and update others gulp plugins (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
antleblanc authored and roblarsen committed Sep 29, 2019
1 parent d4523a5 commit 648ece2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
# in this file, please see the Travis CI documentation:
# https://docs.travis-ci.com

before_script:
- npm install -g gulp-cli
script: gulp

git:
depth: 10

language: node_js

node_js:
- 6
- 8
- 9
- 10

dist: trusty
sudo: false
41 changes: 26 additions & 15 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
import gulp from 'gulp';
import pkg from './package.json';
import header from 'gulp-header';
import cssimport from 'gulp-cssimport';
import del from 'del';
import plugins from 'gulp-load-plugins';
import del from 'del';

import pkg from './package.json';

const license = `/* ${pkg.name} ${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`;

const src = './src/';
const src = './src';
const dist = './dist/';
const main = 'main.css';
let files = [
`${src}/_base.css`,
`${src}/_helpers.css`,
`${src}/_mqs.css`,
`${src}/_print.css`
];


gulp.task('concat', () => {
gulp.src(src + main)
.pipe(cssimport())
.pipe(header(license))
return gulp.src(`${src}/main.css`)
.pipe(plugins().cssimport())
.pipe(plugins().header(license))
.pipe(plugins().autoprefixer({
cascade: false
}))
.pipe(gulp.dest(dist));
});

gulp.task('copy', () => {
gulp.src(files,{})
.pipe(header(license))
return gulp.src(files, {})
.pipe(plugins().header(license))
.pipe(gulp.dest(dist));
});
gulp.task('clean', () => {
del([dist]);

gulp.task('clean', (done) => {
del([
dist
]).then(() => {
done();
});
});

gulp.task('default',['copy','concat']);
gulp.task(
'build',
gulp.series(
'clean',
gulp.parallel('copy', 'concat')
)
);

gulp.task('default', gulp.series('build'));
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "The main.css file from HTML5 Boilerplate",
"main": "index.js",
"scripts": {
"build": "gulp build",
"lint:js": "eslint .",
"test": "npm run lint:js"
},
Expand All @@ -29,11 +30,11 @@
"babel-preset-env": "^1.7.0",
"del": "^4.1.1",
"eslint": "^6.0.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.1.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.0",
"gulp-cssimport": "^7.0.0",
"gulp-header": "^2.0.7",
"gulp-load-plugins": "^1.6.0",
"gulp-header": "^2.0.9",
"gulp-load-plugins": "^2.0.1",
"stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.2.0"
},
Expand Down

0 comments on commit 648ece2

Please sign in to comment.