gulp-sass-bulk-import icon indicating copy to clipboard operation
gulp-sass-bulk-import copied to clipboard

Commented out //@import gets included

Open benmirkhah opened this issue 10 years ago • 9 comments

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 ;)

benmirkhah avatar Jun 10 '15 06:06 benmirkhah

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

x35a avatar Jun 14 '15 15:06 x35a

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

denisborovikov avatar Jun 14 '15 15:06 denisborovikov

@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";
*/

x35a avatar Jun 14 '15 15:06 x35a

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

denisborovikov avatar Jun 14 '15 15:06 denisborovikov

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

x35a avatar Jun 14 '15 16:06 x35a

@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.

denisborovikov avatar Jun 14 '15 16:06 denisborovikov

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

x35a avatar Jun 14 '15 16:06 x35a

@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?

denisborovikov avatar Jun 14 '15 16:06 denisborovikov

I'll try

x35a avatar Jun 14 '15 16:06 x35a