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.

import statements caveat

See original GitHub issue

sass/libsass#21 is resolved since 11/2014 but still cited as preventing @import statement resolution:

https://github.com/jtangelder/sass-loader/blob/9e7caca80f8a0908289cdbdfe8a80ae5e7e1781e/README.md#caveats

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
grrowlcommented, Mar 16, 2015

@mikeyamadeo until sass-loader gets whatever resolution features they need from libsass, you’ll have to do like this:

webpack.config.js:

      {
        test: /\.s?css$/,
        loaders: [
          'css',
          'sass?includePaths[]='+ path.resolve(__dirname, 'node_modules') +
            '&includePaths[]='+ path.resolve(__dirname, 'bower_components')
            // tells sass-loader to look in these dirs when resolving files
        ]
      }

app.scss:

// These files are in the same directory as app.scss
@import "variables";
@import "breakpoints";

// These files are in the bower_components directory
@import "susy/sass/susy"; // resolves to bower_components/susy/sass/_susy.scss
@import "compass-breakpoint/stylesheets/breakpoint"; // resolves to bower_components/compass-breakpoint/stylesheets/breakpoint.scss

If you use a lot of a library (such as pulling selective files from bootstrap), you could add that to your includePaths like '&includePaths[]='+ path.resolve(__dirname, 'bower_components', 'bootstrap-sass', 'assets', 'stylesheets')

1reaction
grrowlcommented, Mar 16, 2015

but note your webpack resolve.alias settings won’t never be taken into consideration for sass @imports, until https://github.com/jtangelder/sass-loader/pull/53

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caveat Emptor (Buyer Beware): What It Is, and What Replaced It
Caveat emptor is a Latin phrase that translates to "let the buyer beware." It means that an individual buys at their own risk....
Read more >
7. Simple statements — Python 3.11.1 documentation
The syntax for simple statements is: Expression statement... ... For targets which are attribute references, the same caveat about class and instance ...
Read more >
Absolute imports - The Conservative Python 3 Porting Guide
In Python 3, the feature becomes the default. To prepare for this, make sure all imports are either absolute, or explicitly relative.
Read more >
Python import: Advanced Techniques and Tips
This tutorial will provide a thorough overview of Python's import statement and how it works. The import system is powerful, and you'll learn...
Read more >
What Does 'Caveat Emptor' Mean? - FindLaw
Literally speaking, caveat emptor means "let the buyer beware. ... The term is actually part of a longer statement: Caveat emptor, quia ignorare...
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