Git Product home page Git Product logo

Comments (6)

grrowl avatar grrowl commented on May 18, 2024 5

@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')

from sass-loader.

mikeyamadeo avatar mikeyamadeo commented on May 18, 2024 1

Hi. I've just begun configuring with webpack and for the life of me hadn't be able to get imports to resolve w/ a combination of webpack aliasing and modulesDirectories using sass-loader.

"File to import not found or unreadable" is my ever occurring error.

Alas, I read the sass-loader caveat. Just wanted to confirm my understanding after reading through the issues that a solution to this is still being worked on? @jhnns

Thanks!

from sass-loader.

grrowl avatar grrowl commented on May 18, 2024 1

but note your webpack resolve.alias settings won't never be taken into consideration for sass @imports, until #53

from sass-loader.

jhnns avatar jhnns commented on May 18, 2024

#31

from sass-loader.

jhnns avatar jhnns commented on May 18, 2024

Just wanted to confirm my understanding after reading through the issues that a solution to this is still being worked on?

Yes

from sass-loader.

mikeyamadeo avatar mikeyamadeo commented on May 18, 2024

@grrowl Thank You! I appreciate you taking the time to help me out on this. This does just the trick.

from sass-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.