question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't compile when importing scss file with underscores

See original GitHub issue

This does not compile:

gulp.task('sass', function () {
    return gulp.src([
        'bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss'
    ])
        .pipe(sass())
        .pipe(gulp.dest('css'));
});

I have to rename _bootstrap.scss to bootstrap.scss to be able to compile it, like this:

gulp.task('sass', function () {
    return gulp.src([
        'bower_components/bootstrap-sass/assets/stylesheets/bootstrap.scss'
    ])
        .pipe(sass())
        .pipe(gulp.dest('css'));
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
Snugugcommented, Sep 2, 2015

Files starting with underscores are partials in Sass and, by the language definition, are not compiled.

On Sep 2, 2015, at 6:46 AM, George Geladaris notifications@github.com wrote:

This does not compile:

gulp.task(‘sass’, function () { return gulp.src([ ‘bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss’ ]) .pipe(sass()) .pipe(gulp.dest(‘css’)); }); I have to rename _bootstrap.scss to bootstrap.scss to be able to compile it, like this:

gulp.task(‘sass’, function () { return gulp.src([ ‘bower_components/bootstrap-sass/assets/stylesheets/bootstrap.scss’ ]) .pipe(sass()) .pipe(gulp.dest(‘css’)); }); — Reply to this email directly or view it on GitHub.

0reactions
LoveAndHappinesscommented, Sep 11, 2015

Yes, you (@Keats, @OEvgeny) are right. I misunderstood how to work properly with bootstrap. I’ll close the ticket, because I understand it now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-sass compiler not compiling scss file starting with ...
From the Docs: The underscore lets Sass know that the file is only a partial file and that it should not be generated...
Read more >
Importing sass into underscores theme
You can see that it already imports some other files from the sass/ directory, as an example. However, you should not enqueue the...
Read more >
Solved: Compiling SCSS files with an underscore in the fil...
Normally I place an underscore for the partials without using an underscore when importing the files into the main sass document as per....
Read more >
Importing Sass Partials - LearnHowToProgram.com
The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS...
Read more >
How to create a file by file custom SCSS build including ...
The cross app split chunks inside the worker scope work very well. The same goes for browsers themselves: Dynamically importing files will ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found