refactor gulp tasks, update all gulp dependencies #2122

This commit is contained in:
Hakim El Hattab 2020-03-03 21:01:35 +01:00
commit 2184a5058a
5 changed files with 3577 additions and 3904 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
/*!
/**
* reveal.js
* http://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, http://hakim.se
* Copyright (C) Hakim El Hattab, https://hakim.se
*/

85
gulpfile.js Normal file
View File

@ -0,0 +1,85 @@
const gulp = require('gulp')
const zip = require('gulp-zip')
const sass = require('gulp-sass')
const qunit = require('gulp-qunit')
const header = require('gulp-header')
const eslint = require('gulp-eslint')
const uglify = require('gulp-uglify')
const rename = require('gulp-rename')
const minify = require('gulp-clean-css')
const connect = require('gulp-connect')
const autoprefixer = require('gulp-autoprefixer')
const pkg = require('./package.json')
const license = `/*!
* reveal.js <%= pkg.version %> (<%= new Date().toDateString() %>)
* <%= pkg.homepage %>
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/\n`
gulp.task('js', () => gulp.src(['./js/reveal.js'])
.pipe(uglify())
.pipe(header(license, {pkg: pkg}))
.pipe(rename('reveal.min.js'))
.pipe(gulp.dest('./js')))
gulp.task('css-themes', () => gulp.src(['./css/theme/source/*.{sass,scss}'])
.pipe(sass())
.pipe(gulp.dest('./css/theme')))
gulp.task('css-core', gulp.series(
() => gulp.src(['css/reveal.scss']).pipe(sass()).pipe(autoprefixer()).pipe(gulp.dest('./css')),
() => gulp.src(['css/reveal.css']).pipe(minify({
compatibility: 'ie9'
})).pipe(header(license, {pkg: pkg}))
.pipe(gulp.dest('./css'))
))
gulp.task('css', gulp.parallel('css-themes', 'css-core'))
gulp.task('test', gulp.series(
() => gulp.src(['./js/reveal.js']).pipe(eslint()).pipe(eslint.format()),
() => gulp.src(['./test/*.html']).pipe(qunit())
))
gulp.task('default', gulp.series(gulp.parallel('js', 'css'), 'test'))
gulp.task('package', gulp.series('default', () =>
gulp.src([
'./index.html',
'./css/**',
'./js/**',
'./lib/**',
'./images/**',
'./plugin/**',
'./**.md'
]).pipe(zip('reveal-js-presentation.zip')).pipe(gulp.dest('./'))
))
gulp.task('serve', () => {
connect.server({
root: '.',
livereload: true,
open: true,
useAvailablePort: true
})
gulp.watch(['js/reveal.js'], gulp.series('js'))
gulp.watch([
'css/theme/source/*.{sass,scss}',
'css/theme/template/*.{sass,scss}',
], gulp.series('css-themes'))
gulp.watch(['css/reveal.scss'], gulp.series('css-core'))
})

5644
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,18 +2,19 @@
"name": "reveal.js",
"version": "4.0.0-dev",
"description": "The HTML Presentation Framework",
"homepage": "http://revealjs.com",
"homepage": "https://revealjs.com",
"subdomain": "revealjs",
"main": "js/reveal.js",
"license": "MIT",
"scripts": {
"test": "grunt test",
"start": "grunt serve",
"build": "grunt"
"test": "gulp test",
"start": "gulp serve",
"build": "gulp"
},
"author": {
"name": "Hakim El Hattab",
"email": "hakim.elhattab@gmail.com",
"web": "http://hakim.se"
"web": "https://hakim.se"
},
"repository": {
"type": "git",
@ -23,22 +24,53 @@
"node": ">=9.0.0"
},
"devDependencies": {
"express": "^4.16.2",
"grunt": "^1.0.4",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^2.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-jshint": "^2.0.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-sass": "^3.0.2",
"grunt-zip": "~0.17.1",
"load-grunt-tasks": "^4.0.0",
"mustache": "^2.3.0",
"node-sass": "^4.13.1",
"socket.io": "^2.2.0"
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-clean-css": "^4.2.0",
"gulp-connect": "^5.7.0",
"gulp-eslint": "^6.0.0",
"gulp-qunit": "^2.1.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2",
"gulp-uglify": "^3.0.2",
"gulp-header": "^2.0.9",
"gulp-zip": "^5.0.1",
"express": "^4.17.1",
"mustache": "^4.0.0",
"socket.io": "^2.3.0"
},
"license": "MIT"
"eslintConfig": {
"env": {
"browser": true
},
"globals": {
"head": false,
"module": false,
"console": false,
"unescape": false,
"define": false,
"exports": false
},
"rules": {
"curly": 0,
"eqeqeq": 2,
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }],
"wrap-iife": [
2,
"any"
],
"no-use-before-define": [
2,
{
"functions": false
}
],
"new-cap": 2,
"no-caller": 2,
"dot-notation": 0,
"no-undef": 2,
"no-eq-null": 2,
"no-unused-expressions": 2
}
}
}