This commit is contained in:
Kyle Spearrin 2019-04-02 23:22:37 -04:00
parent b2c0b02be4
commit 18f659de7b

View file

@ -1,19 +1,39 @@
const gulp = require('gulp');
const gulpLess = require('gulp-less');
const del = require('del');
const fs = require('fs');
function less() {
return gulp.src([
const paths = {
css: './src/App/Css',
};
const lessFiles = [
'./src/App/Less/android.less',
'./src/App/Less/ios.less',
'./src/App/Less/dark.less',
'./src/App/Less/styles.less'
]).pipe(gulpLess()).pipe(gulp.dest('./src/App/Css'));
'./src/App/Less/styles.less',
];
function less() {
return gulp.src(lessFiles).pipe(gulpLess()).pipe(gulp.dest(paths.css));
}
function fixLess(cb) {
fs.readdir(paths.css, (err, cssFiles) => {
cssFiles.forEach((cssFile) => {
const file = paths.css + '/' + cssFile;
let fileContents = fs.readFileSync(file, 'utf8');
fileContents = fileContents.replace(/ \^ /g, '^');
fs.writeFileSync(file, fileContents, 'utf8');
});
cb();
});
}
function cleanCss() {
return del('./src/App/Css');
return del(paths.css);
}
exports.cleanCss = cleanCss;
exports.less = gulp.series(cleanCss, less);
exports.fixLess = fixLess;
exports.less = gulp.series(cleanCss, less, fixLess);