commit
7e61a803f1
39
gulpfile.js
39
gulpfile.js
|
@ -4,14 +4,11 @@ var plumber = require('gulp-plumber');
|
||||||
var sass = require('gulp-sass');
|
var sass = require('gulp-sass');
|
||||||
var babel = require('gulp-babel');
|
var babel = require('gulp-babel');
|
||||||
var postcss = require('gulp-postcss');
|
var postcss = require('gulp-postcss');
|
||||||
var watch = require('gulp-watch');
|
|
||||||
var touch = require('gulp-touch-fd');
|
var touch = require('gulp-touch-fd');
|
||||||
var rename = require('gulp-rename');
|
var rename = require('gulp-rename');
|
||||||
var concat = require('gulp-concat');
|
var concat = require('gulp-concat');
|
||||||
var uglify = require('gulp-uglify');
|
var uglify = require('gulp-uglify');
|
||||||
var imagemin = require('gulp-imagemin');
|
var imagemin = require('gulp-imagemin');
|
||||||
var ignore = require('gulp-ignore');
|
|
||||||
var rimraf = require('gulp-rimraf');
|
|
||||||
var sourcemaps = require('gulp-sourcemaps');
|
var sourcemaps = require('gulp-sourcemaps');
|
||||||
var browserSync = require('browser-sync').create();
|
var browserSync = require('browser-sync').create();
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
|
@ -86,28 +83,6 @@ gulp.task(
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Run:
|
|
||||||
// gulp cssnano
|
|
||||||
// Minifies CSS files
|
|
||||||
gulp.task('cssnano', function () {
|
|
||||||
return gulp
|
|
||||||
.src(paths.css + '/theme.css')
|
|
||||||
.pipe(sourcemaps.init({ loadMaps: true }))
|
|
||||||
.pipe(
|
|
||||||
plumber({
|
|
||||||
errorHandler: function (err) {
|
|
||||||
console.log(err);
|
|
||||||
this.emit('end');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.pipe(rename({ suffix: '.min' }))
|
|
||||||
.pipe(cssnano({ discardComments: { removeAll: true } }))
|
|
||||||
.pipe(sourcemaps.write('./'))
|
|
||||||
.pipe(gulp.dest(paths.css))
|
|
||||||
.pipe(touch());
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('minifycss', function () {
|
gulp.task('minifycss', function () {
|
||||||
|
|
||||||
return gulp
|
return gulp
|
||||||
|
@ -135,11 +110,11 @@ gulp.task('minifycss', function () {
|
||||||
.pipe(touch());
|
.pipe(touch());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete minified CSS files and their maps
|
||||||
|
*/
|
||||||
gulp.task('cleancss', function () {
|
gulp.task('cleancss', function () {
|
||||||
return gulp
|
return del(paths.css + '/*.min.css*');
|
||||||
.src(`${paths.css}/*.min.css`, { read: false }) // Much faster
|
|
||||||
.pipe(ignore('theme.css'))
|
|
||||||
.pipe(rimraf());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('styles', function (callback) {
|
gulp.task('styles', function (callback) {
|
||||||
|
@ -172,11 +147,7 @@ gulp.task('scripts', function () {
|
||||||
];
|
];
|
||||||
gulp
|
gulp
|
||||||
.src(scripts, { allowEmpty: true })
|
.src(scripts, { allowEmpty: true })
|
||||||
.pipe(babel(
|
.pipe(babel({ presets: ['@babel/preset-env'] }))
|
||||||
{
|
|
||||||
presets: ['@babel/preset-env']
|
|
||||||
}
|
|
||||||
))
|
|
||||||
.pipe(concat('theme.min.js'))
|
.pipe(concat('theme.min.js'))
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
.pipe(gulp.dest(paths.js));
|
.pipe(gulp.dest(paths.js));
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
|
@ -11,7 +11,7 @@
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/holger1411/understrap.git"
|
"url": "https://github.com/understrap/understrap.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"wordpress",
|
"wordpress",
|
||||||
|
@ -23,36 +23,31 @@
|
||||||
"author": "Holger Koenemann",
|
"author": "Holger Koenemann",
|
||||||
"license": "GPL-2.0",
|
"license": "GPL-2.0",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/holger1411/understrap/issues"
|
"url": "https://github.com/understrap/understrap/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://understrap.com",
|
"homepage": "https://understrap.com",
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"@babel/preset-env": "^7.7.7",
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.9.0",
|
||||||
|
"@babel/preset-env": "^7.9.5",
|
||||||
|
"autoprefixer": "^9.7.6",
|
||||||
"bootstrap": "^4.4.1",
|
"bootstrap": "^4.4.1",
|
||||||
"browser-sync": "^2.26.7",
|
"browser-sync": "^2.26.7",
|
||||||
"del": "^4.1.1",
|
"del": "^4.1.1",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-autoprefixer": "^6.1.0",
|
"gulp-babel": "^8.0.0",
|
||||||
"gulp-clean-css": "^4.2.0",
|
"gulp-clean-css": "^4.3.0",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-ignore": "^2.0.2",
|
|
||||||
"gulp-imagemin": "^5.0.3",
|
"gulp-imagemin": "^5.0.3",
|
||||||
"gulp-plumber": "^1.2.1",
|
"gulp-plumber": "^1.2.1",
|
||||||
|
"gulp-postcss": "^8.0.0",
|
||||||
"gulp-rename": "^1.4.0",
|
"gulp-rename": "^1.4.0",
|
||||||
"gulp-replace": "^1.0.0",
|
"gulp-replace": "^1.0.0",
|
||||||
"gulp-rimraf": "^0.2.2",
|
"gulp-sass": "^4.1.0",
|
||||||
"gulp-sass": "^4.0.2",
|
|
||||||
"gulp-sourcemaps": "^2.6.5",
|
"gulp-sourcemaps": "^2.6.5",
|
||||||
"gulp-touch-fd": "^2.0.0",
|
"gulp-touch-fd": "^2.0.0",
|
||||||
"gulp-uglify": "^3.0.2",
|
"gulp-uglify": "^3.0.2",
|
||||||
"gulp-watch": "^5.0.1",
|
|
||||||
"undescores-for-npm": "^1.0.0"
|
"undescores-for-npm": "^1.0.0"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.7.7",
|
|
||||||
"autoprefixer": "^9.7.3",
|
|
||||||
"gulp-babel": "^8.0.0",
|
|
||||||
"gulp-postcss": "^8.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue