Comments (6)
@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.
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.
but note your webpack resolve.alias
settings won't never be taken into consideration for sass @imports
, until #53
from sass-loader.
from sass-loader.
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.
@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)
- [Windows]: [email protected] will throw a python not found error HOT 36
- VueJs is not compiling parent selector HOT 1
- Document outputStyle is set to compressed in production mode HOT 4
- Styles for styles.scss block is not defined HOT 1
- Custom sass functions suddenly do not work? Or the API has changed? HOT 1
- Node Sass 9.0.0 HOT 1
- Before publish to npm , 'prepare' scripts should be removed HOT 15
- Potential Security Vulnerabilities Detected in Package
- error HOT 2
- SCSS Not compile functions properly.
- Missing version upgrade/migration guides HOT 1
- Use the Sass Compiler API HOT 4
- Update v10 to allow use node-sass@9 HOT 3
- Unable to use meta.get-mixin to pass mixin as a value to another mixin, then use it in its content. HOT 2
- v10.5.1 still not support node-sass 9 HOT 1
- Make it easier to prefer `sass-embedded` over `sass` HOT 2
- Global variable scope when using `additionalData` option HOT 3
- sass error while compiling semantic ui css file HOT 2
- webpack condition is not accepted when loading from packages HOT 3
- I try to import custom theme and want to use css file in scss using @use but its got error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sass-loader.