Create sass compile task

This commit is contained in:
Roman Hotsiy 2015-11-22 13:49:31 +02:00
parent 1b28956874
commit 418dc6316d
2 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,9 @@ var sourcemaps = require('gulp-sourcemaps');
var paths = require('../paths');
var fs= require('fs');
var concat = require('gulp-concat');
var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
paths.redocBuilt = path.join(paths.output, paths.outputName);
gulp.task('build', function (callback) {
@ -19,8 +22,9 @@ gulp.task('build', function (callback) {
gulp.task('bundle', ['bundleSfx', 'concatDeps']);
gulp.task('inlineTemplates', function() {
gulp.task('inlineTemplates', ['sass'], function() {
return gulp.src(paths.source, { base: './' })
.pipe(replace(/'(.*?\.css)'/g, '\'.tmp/$1\''))
.pipe(inlineNg2Template({ base: '/' }))
.pipe(gulp.dest(paths.tmp));
});
@ -30,6 +34,12 @@ var JS_DEV_DEPS = [
'node_modules/reflect-metadata/Reflect.js'
];
gulp.task('sass', function () {
return gulp.src(paths.css, { base: './' })
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest(paths.tmp));
});
// concatenate angular2 deps
gulp.task('concatDeps', ['bundleSfx'], function() {
gulp.src(JS_DEV_DEPS.concat([paths.redocBuilt]))

View File

@ -58,6 +58,7 @@
"gulp-inline-ng2-template": "0.0.7",
"gulp-jshint": "^1.11.2",
"gulp-replace": "^0.5.4",
"gulp-sass": "^2.1.0",
"gulp-sourcemaps": "^1.6.0",
"jshint-stylish": "^2.0.1",
"jspm": "^0.16.11",