Skip to content

Commit a4652bf

Browse files
authored
BC-11169 Speed up build (#333)
1 parent b4f96a5 commit a4652bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+6492
-22909
lines changed

gulpfile.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
const {src, dest, series, parallel, watch, lastRun} = require('gulp');
22
const sass = require('gulp-sass')(require('sass'));
3-
const sassGrapher = require('gulp-sass-grapher');
4-
const path = require('path');
53
const rimraf = require('gulp-rimraf');
64
const uglify = require('gulp-uglify');
75
const cleancss = require('clean-css');
86
const map = require('vinyl-map');
9-
const imagemin = require('gulp-imagemin');
107
const babel = require('gulp-babel');
118
const filelog = require('gulp-filelog');
129
const plumber = require('gulp-plumber');
@@ -65,7 +62,6 @@ const beginPipeAll = path =>
6562
//minify images
6663
function images() {
6764
return beginPipe('./static/images/**/*.*')
68-
.pipe(imagemin())
6965
.pipe(dest('./build/images'));
7066
}
7167
exports.images = images;
@@ -74,12 +70,10 @@ function themeName(){
7470
return process.env.SC_THEME || 'default';
7571
}
7672

77-
var loadPaths = path.resolve('./static/styles/');
78-
sassGrapher.init('./static/styles/', { loadPaths: loadPaths });
7973
function styles() {
8074
var themeFile = `./theme/${themeName()}/style.scss`;
81-
return beginPipe('./static/styles/**/*.{css,sass,scss}')
82-
.pipe(sassGrapher.ancestors())
75+
// Bootstrap is excluded from compilation because it slows down the build. Instead the compiled bootstrap-flex.css is just copied.
76+
return beginPipe(['./static/styles/**/*.{css,sass,scss}', '!./static/styles/lib/bootstrap/scss/**/*'])
8377
.pipe(header(fs.readFileSync(themeFile, 'utf8')))
8478
.pipe(sass({sourceMap: false}))
8579
.pipe(minify())
@@ -164,7 +158,7 @@ function clear() {
164158
exports.clear = clear;
165159

166160
//run all tasks, processing changed files
167-
const all = series(images, styles, fonts, scripts, base_scripts,
161+
const all = parallel(images, styles, fonts, scripts, base_scripts,
168162
vendor_styles, vendor_scripts, vendor_assets);
169163
exports.all = all;
170164

0 commit comments

Comments
 (0)