How to use bootstrap-sass of webpack correctly

  node.js, question

According to the official instructions, I can deploy without introducing the _bootstrap.scss file.
As soon as it is introduced, it will prompt file to import not found, and it also does not know how to solve it. please pray for the great god, thank you very much.


Since you mentioned webpack, which sass-loader do you use? If there is no accident, this one should be used:

If so, you should read its documents carefully.

In short, when you install bootstrap-sass with bower/npm, your own style files (such as app.scss) and bootstrap’s style files are not on the same path that sass can resolve, so you directly@import 'bootstrap-custom'Of course, this document cannot be found.

If you are the compiler of sass, can you tell where’ bootstrap-custom’ is given such an import?

So sass provides aincludePathsUsed to indicate resolving paths, and all you have to do is define it correctly. The specific method is found in the above loader document inside. See for yourself.