csstools / postcss-partial-import

Inline sugary @import statements in CSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strange hanging on close

drewwells opened this issue · comments

First off, thanks for writing this. I like the configurability compared to the postcss sponsored plugin.

I turned this on and pointed PostCSS to the bootstrap source. My task is completing in similar time, but gulp hangs for several seconds afterwards. Disabling this plugin makes the hang go away. Here's my gulp file.

var postcss = require('gulp-postcss');
var gulp = require('gulp');
var syntax = require('postcss-scss');
var rename = require('gulp-rename');

gulp.task('css', function () {
    var plugins = [require('postcss-partial-import')({ extension: "scss"})];

    gulp.src('app.scss')
            .pipe( postcss(plugins, { parser: require('postcss-scss') }) )
            .pipe(rename(function(path){
                path.extname = '.css';
            }))
            .pipe( gulp.dest('build/') )
});

Output

time gulp css
[00:52:57] Using gulpfile ~/code/realbench/gulpfile.js
[00:52:57] Starting 'css'...
[00:52:57] Finished 'css' after 7.26 ms
gulp css  10.78s user 0.20s system 101% cpu 10.820 total

The issue is in your gulpfile. You need to return the stream:

return gulp.src('app.scss')

thanks, that did it!