Maybe I'm doing something wrong, but I can't include a less file from my node_modules folder.
I took a clean install of Laravel 5.4. Next I did:
npm install npm install bootstrapresources/assets/less/app.less@import "node_modules/bootstrap/less/bootstrap";webpack.mix.js file to:mix.js('resources/assets/js/app.js', 'public/js')
.less('resources/assets/less/app.less', 'public/css');
npm run devThis gives me this error: Module build failed: Can't resolve './node_modules/bootstrap/less/bootstrap.less'
When I install Laravel Elixir and try the same less file, it works perfectly... Hope someone can help.
Thanks a lot!
Try @import "../../../node_modules/bootstrap/less/bootstrap";
Okay, that does work. But why does the original path not work for LESS, but it does work for SASS, if you look at the shipped app.scss file, you also see a similar path.
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
You probably need to add some configuration to the less-loader in order to specify a root path.
Yeah it's a less-loader thing. They've had an issue up for a year now about this.
The workaround is to use a tilda, like this:
@import "~bootstrap/less/bootstrap";
@JeffreyWay Perhaps time to bump Nice! You just did - within the last 2 months.laravel-mix's less version up to 3?
Most helpful comment
Yeah it's a less-loader thing. They've had an issue up for a year now about this.
The workaround is to use a tilda, like this: