-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
26 lines (22 loc) · 827 Bytes
/
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
const gulp = require('gulp'),
inlineNg2Template = require('gulp-inline-ng2-template'),
clean = require('gulp-clean'),
sass = require('node-sass');
gulp.task('clean', function () {
return gulp.src(['./tmp', './dist'], {read: false})
.pipe(clean());
});
const styleProcessor = (stylePath, ext, styleFile, callback) => {
if (ext[0] === '.scss') {
let sassObj = sass.renderSync({ file: stylePath });
if (sassObj && sassObj['css']){
styleFile = sassObj.css.toString('utf8');
}
}
return callback(null, styleFile);
};
gulp.task('inline-templates', ['clean'], function () {
return gulp.src('./src/dks-number-input/*.ts')
.pipe(inlineNg2Template({base: 'src/dks-number-input', UseRelativePaths: true, indent: 0, styleProcessor: styleProcessor, removeLineBreaks: true}))
.pipe(gulp.dest('.tmp'));
});