Skip to content

Commit

Permalink
Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Relius-TP committed Oct 25, 2023
0 parents commit a04c3b5
Show file tree
Hide file tree
Showing 146 changed files with 54,988 additions and 0 deletions.
107 changes: 107 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// node.js Packages / Dependencies
const gulp = require('gulp');
const sass = require('gulp-sass');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const cleanCSS = require('gulp-clean-css');
const imageMin = require('gulp-imagemin');
const pngQuint = require('imagemin-pngquant');
const browserSync = require('browser-sync').create();
const autoprefixer = require('gulp-autoprefixer');
const jpgRecompress = require('imagemin-jpeg-recompress');
const clean = require('gulp-clean');


// Paths
var paths = {
root: {
www: './public_html'
},
src: {
root: 'public_html/assets',
html: 'public_html/**/*.html',
css: 'public_html/assets/css/*.css',
js: 'public_html/assets/js/*.js',
vendors: 'public_html/assets/vendors/**/*.*',
imgs: 'public_html/assets/imgs/**/*.+(png|jpg|gif|svg)',
scss: 'public_html/assets/scss/**/*.scss'
},
dist: {
root: 'public_html/dist',
css: 'public_html/dist/css',
js: 'public_html/dist/js',
imgs: 'public_html/dist/imgs',
vendors: 'public_html/dist/vendors'
}
}

// Compile SCSS
gulp.task('sass', function() {
return gulp.src(paths.src.scss)
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest(paths.src.root + '/css'))
.pipe(browserSync.stream());
});

// Minify + Combine CSS
gulp.task('css', function() {
return gulp.src(paths.src.css)
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(concat('meyawo.css'))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(paths.dist.css))
});

// Minify + Combine JS
gulp.task('js', function() {
return gulp.src(paths.src.js)
.pipe(uglify())
.pipe(concat('meyawo.js'))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(paths.dist.js))
.pipe(browserSync.stream());
});

// Compress (JPEG, PNG, GIF, SVG, JPG)
gulp.task('img', function(){
return gulp.src(paths.src.imgs)
.pipe(imageMin([
imageMin.gifsicle(),
imageMin.jpegtran(),
imageMin.optipng(),
imageMin.svgo(),
pngQuint(),
jpgRecompress()
]))
.pipe(gulp.dest(paths.dist.imgs));
});

// copy vendors to dist
gulp.task('vendors', function(){
return gulp.src(paths.src.vendors)
.pipe(gulp.dest(paths.dist.vendors))
});

// clean dist
gulp.task('clean', function () {
return gulp.src(paths.dist.root)
.pipe(clean());
});

// Prepare all assets for production
gulp.task('build', gulp.series('sass', 'css', 'js', 'vendors', 'img'));


// Watch (SASS, CSS, JS, and HTML) reload browser on change
gulp.task('watch', function() {
browserSync.init({
server: {
baseDir: paths.root.www
}
})
gulp.watch(paths.src.scss, gulp.series('sass'));
gulp.watch(paths.src.js).on('change', browserSync.reload);
gulp.watch(paths.src.html).on('change', browserSync.reload);
});
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "Meyawo",
"version": "1.5.0",
"description": "An elegant responsive bootstrap 4.x theme.",
"main": "gulpfile.js",
"author": "DevCRUD",
"scripts": {
"start": "gulp"
},
"devDependencies": {
"browser-sync": "^2.26.3",
"gulp": "^4.0.0",
"gulp-clean-css": "^4.0.0",
"gulp-sass": "^4.0.2",
"gulp-autoprefixer": "^6.1.0",
"gulp-clean": "^0.4.0",
"gulp-concat": "^2.6.1",
"gulp-imagemin": "^5.0.3",
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.2",
"imagemin-jpeg-recompress": "^6.0.0",
"imagemin-pngquant": "^7.0.0"
},
"browserslist": [
"> 1%",
"ie >= 8",
"edge >= 15",
"ie_mob >= 10",
"ff >= 45",
"chrome >= 45",
"safari >= 7",
"opera >= 23",
"ios >= 7",
"android >= 4"
]
}
Loading

0 comments on commit a04c3b5

Please sign in to comment.