forked from andresgalante/patternfly-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (30 loc) · 1.03 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const gulp = require('gulp');
const insert = require('gulp-insert');
const replace = require('gulp-string-replace');
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
gulp.task('build', ['build-modules', 'build-library', 'copy-source']);
gulp.task('build-tmp', () =>
gulp
.src('./src/patternfly/**/*.scss')
.pipe(insert.append('@import "./components/**/*.scss";\n'))
.pipe(insert.append('@import "./layouts/**/*.scss";\n'))
.pipe(sassGlob())
.pipe(replace('@import "../../patternfly-utilities";', ''))
.pipe(gulp.dest('./tmp'))
);
gulp.task('build-library', ['build-tmp'], () =>
gulp
.src('./tmp/patternfly.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist'))
);
gulp.task('build-modules', () =>
gulp
.src('./src/patternfly/{components,layouts,patterns}/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dist'))
);
gulp.task('copy-source', ['build-tmp'], () =>
gulp.src('./tmp/**/*.scss').pipe(gulp.dest('./dist'))
);