commit
7e61a803f1
39
gulpfile.js
39
gulpfile.js
|
@ -4,14 +4,11 @@ var plumber = require('gulp-plumber');
|
|||
var sass = require('gulp-sass');
|
||||
var babel = require('gulp-babel');
|
||||
var postcss = require('gulp-postcss');
|
||||
var watch = require('gulp-watch');
|
||||
var touch = require('gulp-touch-fd');
|
||||
var rename = require('gulp-rename');
|
||||
var concat = require('gulp-concat');
|
||||
var uglify = require('gulp-uglify');
|
||||
var imagemin = require('gulp-imagemin');
|
||||
var ignore = require('gulp-ignore');
|
||||
var rimraf = require('gulp-rimraf');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var browserSync = require('browser-sync').create();
|
||||
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 () {
|
||||
|
||||
return gulp
|
||||
|
@ -135,11 +110,11 @@ gulp.task('minifycss', function () {
|
|||
.pipe(touch());
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete minified CSS files and their maps
|
||||
*/
|
||||
gulp.task('cleancss', function () {
|
||||
return gulp
|
||||
.src(`${paths.css}/*.min.css`, { read: false }) // Much faster
|
||||
.pipe(ignore('theme.css'))
|
||||
.pipe(rimraf());
|
||||
return del(paths.css + '/*.min.css*');
|
||||
});
|
||||
|
||||
gulp.task('styles', function (callback) {
|
||||
|
@ -172,11 +147,7 @@ gulp.task('scripts', function () {
|
|||
];
|
||||
gulp
|
||||
.src(scripts, { allowEmpty: true })
|
||||
.pipe(babel(
|
||||
{
|
||||
presets: ['@babel/preset-env']
|
||||
}
|
||||
))
|
||||
.pipe(babel({ presets: ['@babel/preset-env'] }))
|
||||
.pipe(concat('theme.min.js'))
|
||||
.pipe(uglify())
|
||||
.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": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/holger1411/understrap.git"
|
||||
"url": "https://github.com/understrap/understrap.git"
|
||||
},
|
||||
"keywords": [
|
||||
"wordpress",
|
||||
|
@ -23,36 +23,31 @@
|
|||
"author": "Holger Koenemann",
|
||||
"license": "GPL-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/holger1411/understrap/issues"
|
||||
"url": "https://github.com/understrap/understrap/issues"
|
||||
},
|
||||
"homepage": "https://understrap.com",
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.7.7",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/preset-env": "^7.9.5",
|
||||
"autoprefixer": "^9.7.6",
|
||||
"bootstrap": "^4.4.1",
|
||||
"browser-sync": "^2.26.7",
|
||||
"del": "^4.1.1",
|
||||
"font-awesome": "^4.7.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-autoprefixer": "^6.1.0",
|
||||
"gulp-clean-css": "^4.2.0",
|
||||
"gulp-babel": "^8.0.0",
|
||||
"gulp-clean-css": "^4.3.0",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-ignore": "^2.0.2",
|
||||
"gulp-imagemin": "^5.0.3",
|
||||
"gulp-plumber": "^1.2.1",
|
||||
"gulp-postcss": "^8.0.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-rimraf": "^0.2.2",
|
||||
"gulp-sass": "^4.0.2",
|
||||
"gulp-sass": "^4.1.0",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-touch-fd": "^2.0.0",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"gulp-watch": "^5.0.1",
|
||||
"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