diff --git a/.travis.yml b/.travis.yml index c4383f9..cbe0e30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/gulpfile.babel.js b/gulpfile.babel.js index f7a720b..6fd6fe2 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -1,15 +1,13 @@ 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`, @@ -17,23 +15,36 @@ let files = [ `${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')); diff --git a/package.json b/package.json index cbae8db..23f1cba 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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" },