-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add node_modules to the include path? #554
Comments
Give this a try in your webpack.mix.js file. mix.sass('resources/assets/sass/app.scss', 'css', {
includePaths: ['node_modules']
}); |
Thank you!!! I'm not sure why I couldn't find that! The imports now work in the .scss file, but I'm still getting errors when trying to import from a .vue file, such as:
|
For laravel-mix 5 try in your webpack.mix.js
|
It works in v6 as well \m/ |
This works but the node module's css gets imported before all my other styles even though I have it importing into a sass file towards the end. |
Unfortunately this is a sass problem with mixed sass & css imports: #2793 |
node -v
): 6.10.0npm -v
): 3.10.10Description:
I am trying to use an NPM package called material-components-web. When I include the main .scss file, it includes other dependencies within itself. Here is the problem though: it doesn't use a path relative to itself, the path is relative to node_modules. According to the official documentation:
I've tried everything I can think of trying to merge using mix's webpackConfig. Webpack's documentation is a little confusing, to say the least.
Has anyone figured this out?
Thanks for your time!
Steps To Reproduce:
On command line,
npm install material-components-web
In my app.scss file,
@import "node_modules/material-components-web/material-components-web";
Then when I try to compile,
npm run dev
I get this:
Module build failed: ModuleBuildError: Module build failed: @import "@material/animation/mdc-animation"; ^ File to import not found or unreadable: @material/animation/mdc-animation.
The text was updated successfully, but these errors were encountered: