Merge pull request #1040 from lilumi/lm-improve

add "custom-editor-style" and other scss files at this level to minify and watch for changes, also update modification date for generated files
This commit is contained in:
UnderstrapFramework 2019-12-13 11:26:51 +00:00 committed by GitHub
commit 3f7fd8ff36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 36 deletions

View File

@ -47,11 +47,11 @@ before_script:
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# Create WordPress database.
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
#- mysql -u root -e "CREATE DATABASE wordpress_test;"
# Install CodeSniffer for WordPress Coding Standards checks.
- mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/2.7.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer
- mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/3.5.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer
# Install WordPress Coding Standards.
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/archive/0.10.0.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress/WordPress-Coding-Standards/archive/2.1.1.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards
# Hop into CodeSniffer directory.
- cd php-codesniffer
# Set install path for WordPress Coding Standards

View File

@ -1,4 +1,4 @@
Travis build: [![Build Status](https://travis-ci.org/understrap/understrap.svg?branch=master)](https://travis-ci.org/understrap/understrap)
Travis build: [![Build Status](https://api.travis-ci.org/lilumi/understrap.svg?branch=lm-improve)](https://travis-ci.org/lilumi/understrap)
#### See: [Official Demo](https://understrap.com/understrap) | Read: [Official Docs Page](https://understrap.github.io/)

View File

@ -5,6 +5,7 @@ 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');
@ -41,7 +42,8 @@ gulp.task('sass', function() {
.pipe(sass({ errLogToConsole: true }))
.pipe(postcss([autoprefixer()]))
.pipe(sourcemaps.write(undefined, { sourceRoot: null }))
.pipe(gulp.dest(paths.css));
.pipe(gulp.dest(paths.css))
.pipe(touch());
return stream;
});
@ -49,7 +51,7 @@ gulp.task('sass', function() {
// gulp watch
// Starts watcher. Watcher runs gulp sass task on changes
gulp.task('watch', function () {
gulp.watch(`${paths.sass}/**/*.scss`, gulp.series('styles'));
gulp.watch([`${paths.sass}/**/*.scss`, `${paths.sass}/*.scss`], gulp.series('styles'));
gulp.watch(
[
`${paths.dev}/js/**/*.js`,
@ -103,14 +105,23 @@ gulp.task('cssnano', function() {
.pipe(rename({ suffix: '.min' }))
.pipe(cssnano({ discardComments: { removeAll: true } }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.css));
.pipe(gulp.dest(paths.css))
.pipe(touch());
});
gulp.task('minifycss', function () {
return gulp
.src(`${paths.css}/theme.css`)
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(cleanCSS({ compatibility: '*' }))
.src([
`${paths.css}/custom-editor-style.css`,
`${paths.css}/theme.css`,
])
.pipe(sourcemaps.init({
loadMaps: true
}))
.pipe(cleanCSS({
compatibility: '*'
}))
.pipe(
plumber({
errorHandler: function (err) {
@ -121,7 +132,8 @@ gulp.task('minifycss', function() {
)
.pipe(rename({ suffix: '.min' }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.css));
.pipe(gulp.dest(paths.css))
.pipe(touch());
});
gulp.task('cleancss', function () {
@ -149,6 +161,7 @@ gulp.task('scripts', function() {
var scripts = [
// Start - All BS4 stuff
`${paths.dev}/js/bootstrap4/bootstrap.bundle.js`,
`${paths.dev}/js/themejs/*.js`,
// End - All BS4 stuff
@ -304,7 +317,8 @@ gulp.task(
{ skipBinary: true }
)
)
.pipe(gulp.dest(paths.dist));
.pipe(gulp.dest(paths.dist))
.pipe(touch());
})
);
@ -332,7 +346,8 @@ gulp.task(
`!${paths.distprod}/**`,
'*'
])
.pipe(gulp.dest(paths.distprod));
.pipe(gulp.dest(paths.distprod))
.pipe(touch());
})
);

View File

@ -29,7 +29,7 @@
"dependencies": {
"@babel/preset-env": "^7.4.5",
"bootstrap": "^4.3.1",
"browser-sync": "^2.26.3",
"browser-sync": "^2.26.7",
"del": "^4.1.0",
"font-awesome": "^4.7.0",
"gulp": "^4.0.0",
@ -45,6 +45,7 @@
"gulp-sass": "^4.0.2",
"gulp-sequence": "^1.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-touch-fd": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"run-sequence": "^2.2.1",