Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mocassin.css/gulpfile.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (40 sloc)
1.15 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utilities | |
var autoprefixer = require('gulp-autoprefixer'); | |
var cssmin = require('gulp-cssmin'); | |
var jsmin = require('gulp-jsmin'); | |
// Gulp | |
var gulp = require('gulp'); | |
// Gulp Plugins | |
var sass = require('gulp-sass'); | |
var rename = require('gulp-rename'); | |
// Path Config | |
var configPath = { | |
inputCSS: 'src/*.scss', | |
outputCSS: 'dist/css/', | |
// Js Path | |
inputJS: 'dist/js/*.js', | |
outputJS: 'dist/js/' | |
} | |
gulp.task('createCSS', function () { | |
// Find main `.css` file from the `src/` folder | |
return gulp.src(configPath.inputCSS) | |
// Run Sass on those files | |
.pipe(sass({outputStyle: 'expanded'})) | |
.pipe(autoprefixer({ | |
browser: ['last 2 versions'], | |
cascade: false | |
})) | |
.pipe(gulp.dest(configPath.outputCSS)) | |
.pipe(cssmin()) | |
.pipe(rename({suffix: '.min'})) | |
// Write the resulting CSS in the output folder | |
.pipe(gulp.dest(configPath.outputCSS)) | |
}); | |
// Minify JS File | |
gulp.task('minifyJS', function () { | |
return gulp.src(configPath.inputJS) | |
.pipe(jsmin()) | |
.pipe(rename({suffix: '.min'})) | |
// Write the resulting Minify JS in the output folder | |
.pipe(gulp.dest(configPath.outputJS)) | |
}); | |