mathisonian / gulp-sass-bulk-import

gulp task to allow importing directories in your SCSS
MIT License
42 stars 11 forks source link

Commented out //@import gets included #11

Open benmirkhah opened 9 years ago

benmirkhah commented 9 years ago

So if an import line is commented out like:

//@import "some/folder/*";

it gets compiled into:

//@import "Users/benmirkhah/web/project/some/folder/_first-file.scss"; @import "Users/benmirkhah/web/project/some/folder/_second-file.scss"; @import "Users/benmirkhah/web/project/some/folder/_third-file.scss";

which is bad, commenting with /* */ works as intended.

Also notice how all the folder's full pwd path gets included which is unlike what was advertised in your example ;)

x35a commented 9 years ago

@benmirkhah Hi, you said - 'Using /* */ works fine'. Can u pls give example how to get it work fine.

denisborovikov commented 9 years ago

@rosivanov May be /*@import "some/folder/*"; */

x35a commented 9 years ago

@denisborovikov nope... just commented output

/*@import "C:/Users/admin/Desktop/e/poly/gu/sassimport/_a.scss";
@import "C:/Users/admin/Desktop/e/poly/gu/sassimport/_b.scss";
*/
denisborovikov commented 9 years ago

@rosivanov Yep, and this scss will not be compiled. What did you want?

x35a commented 9 years ago

Well how to change absolute path like @import "Users/benmirkhah/web/project/some/folder/_second-file.scss"; to relative path.

denisborovikov commented 9 years ago

@rosivanov Why absolute path is not working for you in this case? benmirkhah is just wrote about how to comment an import not to fix paths.

x35a commented 9 years ago

Absolute path works fine. Regarding relative path it was just curiosity and obviously i understood benmirkhah's wrong.

denisborovikov commented 9 years ago

@rosivanov Now I see what are you talking about. Something like this should work (but with absolute paths for now).

var bulkSass = require('gulp-sass-bulk-import');

gulp.task('import', function() {
    return gulp
            .src(srcDir + '*.scss')
            .pipe(bulkSass())
            .pipe(gulp.dest(srcDir));
});

But why don't you want to import scss files on the fly as a part of your sass task?

x35a commented 9 years ago

I'll try