Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var gulp = require('gulp');
- var paths = gulp.paths;
- var $ = require('gulp-load-plugins')();
- gulp.task('styles', function () {
- var sassOptions = {
- style: 'expanded'
- };
- var injectFiles = gulp.src([
- paths.src + '/{app,components,styles}/**/*.scss',
- '!' + paths.src + '/app/styles.scss',
- ], { read: false });
- var injectOptions = {
- transform: function(filePath) {
- filePath = filePath.replace(paths.src + '/app/', '');
- filePath = filePath.replace(paths.src + '/components/', '../components/');
- filePath = filePath.replace(paths.src + '/styles/', '../styles/');
- return '@import \'' + filePath + '\';';
- },
- starttag: '// injector',
- endtag: '// endinjector',
- addRootSlash: false
- };
- var indexFilter = $.filter('styles.scss');
- return gulp.src([
- paths.src + '/app/styles.scss'
- ])
- .pipe(indexFilter)
- //.pipe($.inject(injectFiles, injectOptions))
- //.pipe(indexFilter.restore())
- .pipe($.sass(sassOptions))
- .pipe($.autoprefixer())
- .on('error', function handleError(err) {
- console.error(err.toString());
- this.emit('end');
- })
- .pipe(gulp.dest(paths.tmp + '/serve/app/'));
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement