Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nauvalazhar committed Feb 12, 2019
1 parent 7c22e29 commit 0e25c0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 125 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ Want to help Stisla get better? Let's contribute and follow our [contribution gu

## License
Stisla is under the [MIT License](LICENSE)

## Supported by BrowserStack
Thanks to BrowserStack for their support of this open-source project.

[![Browser Stack](https://getstisla.com/svg/Browserstack-logo.svg)]
138 changes: 13 additions & 125 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,125 +1,13 @@
// Gulp file config by iqbal

const {src, dest, watch, parallel} = require('gulp');
const notify = require('gulp-notify');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');
const concat = require('gulp-concat');
const plumber = require('gulp-plumber');
const rename = require('gulp-rename');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const uglify = require('gulp-uglify');
const imagemin = require('gulp-imagemin');
const imageminMozjpeg = require('imagemin-mozjpeg');
//dir
var cssDir = './assets/css';
var jsDir = './assets/js';
var sassDir = './assets/sass/*.scss';
var imgDir = './assets/img/*';

//css
var cssFileOne = 'path';
var cssFileTwo = 'path';
var cssFileThree = 'path';

//js
var jsFileOne = 'path';
var jsFileTwo = 'path';
var jsFileThree = 'path';

// moving js
function js(){
return src([jsFileOne, jsFileTwo, jsFileThree])
.pipe(plumber())
.pipe(concat('plugin.min.js'))
.pipe(uglify())
.pipe(dest(jsDir))
.pipe(notify({
message: 'File <%= file.relative %> wis dadi'
}));
}

// moving css
function css(){
return src([cssFileOne,cssFileTwo,cssFileThree,])
.pipe(plumber())
.pipe(concat('plugin.min.css'))
.pipe(postcss([autoprefixer(), cssnano()]))
.pipe(dest(cssDir))
.pipe(notify({
message: 'File <%= file.relative %> wis dadi'
}));
}

//make structural folder
function folder(){
return src('*.*', {read: false})
.pipe(dest('./sandbox/_test'))
.pipe(dest('./assets'))
.pipe(dest('./assets/sass'))
.pipe(dest('./assets/css'))
.pipe(dest('./assets/js'))
.pipe(dest('./assets/img'))
}

//minify compile
function minify(){
return src(sassDir)
.pipe(plumber())
.pipe(sass({
errorLogToConsole: true
}))
.on('error', console.error.bind( console ))
.pipe(rename({
suffix: '.min'
}))
.pipe(postcss([autoprefixer(), cssnano()]))
.pipe(dest(cssDir))
.pipe(notify({
message: 'Minify <%= file.relative %> berhasil bos'
}));
}


//minfy image
function image(){
return src(imgDir)
.pipe(plumber())
.pipe(imagemin([
imageminMozjpeg({quality: 80})
]))
.pipe(dest(imgDir))
.pipe(plumber.stop())
}

function watching (){
browserSync.init({
server:{
baseDir: "./"
},
port: 8080
});
watch('./assets/sass/*.scss',minify).on('change',browserSync.reload);
watch("*.html").on('change',browserSync.reload);
}

function watchcss(){
watch('./assets/sass/*.scss',minify);
}

//create folder first
exports.folder = folder;
//then update source
exports.update = parallel(js, css);
//updating JS SOURCE ONLY
exports.js = js;
//updating CSS SOURCE ONLY
exports.css = css;
//minify IMG SOURCE
exports.image = image;
//Run this command for styling OPs
exports.minify = minify;
//Run this command for dev.
exports.default = watching;
const { series } = require('gulp');

function clean(cb) {

cb();
}

function build(cb) {
cb();
}

exports.build = build;
exports.default = series(clean, build);

0 comments on commit 0e25c0f

Please sign in to comment.