Skip to content
Permalink
Browse files

Getting theme ready for a test drive

  • Loading branch information
ChrisWiegman committed Aug 18, 2020
1 parent 5ccc40e commit c6ae70885dc4e7f8c9fc64595734aa988a9639bf
@@ -197,10 +197,9 @@ tmtags
node_modules
vendor
/theme/languages/*.pot
assets/css/*.css
assets/css/*.map
assets/js/*.js
assets/js/*.map
/theme/assets/*.css
/theme/assets/*.js
/theme/assets/*.map
coverage.clover
/theme/scripts/*-min.js

@@ -1,15 +1,33 @@
var gulp = require('gulp');
var gulpMinify = require('gulp-minify');
var gulpSass = require('gulp-sass');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');

function minify () {

return gulp.src(['theme/scripts/*.js'])
.pipe(gulpMinify({
ignoreFiles: ['*-min.js']
}))
.pipe(gulp.dest('theme/scripts'));
function sass () {

gulpSass.compiler = require('node-sass');

return gulp.src('./theme/assets/scss/main.scss')
.pipe(sourcemaps.init())
.pipe(gulpSass().on('error', gulpSass.logError))
.pipe(rename('main.css'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./theme/assets/'));

}

function sassMin () {

gulpSass.compiler = require('node-sass');

return gulp.src('./theme/assets/scss/main.scss')
.pipe(gulpSass({ outputStyle: 'compressed' }).on('error', gulpSass.logError))
.pipe(rename('main.min.css'))
.pipe(gulp.dest('./theme/assets/'));

}

exports.minify = minify;
exports.default = gulp.parallel(minify);
exports.sassMin = sassMin;
exports.sass = sass;
exports.default = gulp.parallel(sass,sassMin);

0 comments on commit c6ae708

Please sign in to comment.
You can’t perform that action at this time.