question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap Sass not recognized

See original GitHub issue
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Running in docker on ElementaryOS (Latest)
  2. Versions. Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here: angular-cli: 1.0.0-beta.11-webpack.2 node: 5.12.0 os: linux x64
  3. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. Just upgraded to rc5.
  4. The log given by the failure. Normally this include a stack trace and some more information. None
  5. Mention any other details that might be useful.

I want to use the bootstrap-sass repo from npm, but webpack is not recognizing it. I read about a bootstrap-sass-loader for webpack, but I can’t find the webpack config file. Anyway I can add/edit loaders etc.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jurienhamakercommented, Aug 30, 2016

Still doesn’t really solve the problem, as importing bootstrap from it’s npm package, can also include overriding variables just for that specific component… Or using variables like the default padding to keep up with code styling throughout your application etc.

Global styles do not solve a sass import…

example: component.scss:

@import "../../styles/bootstrap/bootstrap/variables";

I now have to import it from the downloaded source file, which I have to manually update. Instead of using the npm package.

It doesn’t really matter if angular-cli has global styles, it matters that it recognizes npm sass packages.

More information https://github.com/jtangelder/sass-loader

PS. I tried the ~ method in the sass-loader, still doesn’t work with angular-cli

1reaction
filipesilvacommented, Aug 28, 2016

Components in Angular 2 have their css encapsulated, which means that they don’t bleed out onto other parts of your app. Unfortunately, it also means that you can’t really import bootstrap in your component.

We added global styles to address this: https://github.com/angular/angular-cli#global-styles. It should be available in the next webpack release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gruntjs - @import bootstrap-sass not working - Stack Overflow
I moved that file into my own sass folder, then changed the paths of all the files in the bootstrap.scss file. This youtube...
Read more >
Theming Bootstrap
Customize Bootstrap 4 with our new built-in Sass variables for global style preferences for easy theming and component changes.
Read more >
How to Customize Bootstrap with Sass - freeCodeCamp
The solution is to use Sass – a CSS preprocessor. Sass is compiled down to CSS before it's used on web pages. Until...
Read more >
Sass Compiler NOT Working in Visual Studio Code - YouTube
In this tutorial I am going to explain how to fix the visual studio code live sass compiler extension if it is not...
Read more >
sass-loader - webpack - JS.ORG
Node Sass does not work with Yarn PnP feature and doesn't support @use rule. ... Webpack needs to distinguish between bootstrap and ~bootstrap...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found