I have a vue app with a component using scss. I have installed sass-loader, and it all works great - except when i try to import bootstrap scss files.
This is the specific import thats failing:
<style lang="scss">
@import url("~bootstrap/scss/mixins");
...
I receive the following error:
This dependency was not found:
* -!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!bootstrap/sc
ss/mixins in ./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-load
er/dist/cjs.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Home.vue?vue&type=style&index=0&lang=scss&
To install it, you can run: npm install --save -!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loade
r/src/index.js??ref--8-oneOf-1-2!bootstrap/scss/mixins
In comparison, the following import works fine:
<style lang="scss">
@import url("~bootstrap/dist/css/bootstrap.css");
...
From this it can be concluded that its not the reference to the NPM package thats failing per se. It seems like it is either because of a) i'm not referencing the specific _mixins.scss file correctly, or b) i have to configure my sass loader to be able to import scss files from NPM packages.
Does anyone have an ideas as to what I'm doing wrong? Any input is much appreciated.