Imagine we kick things off with this nifty starter pack: https://github.com/angularclass/angular2-webpack-starter
Once we execute npm install
and npm run start
, everything runs smoothly.
Now, let's say I want to incorporate an external css module, like bootstrap 4's css (just the css). (I am aware of bootstrap-loader, but for now let's focus on a more general solution, using bootstrap 4 as an example).
To get bootstrap via npm:
npm install<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e6c61617a7d7a7c6f7e4e3a203e203e236f627e666f203a">[email protected]</a> --save
Initially, I thought adding
import 'bootstrap/dist/css/bootstrap.css';
to vendor.browser.ts would suffice.
However, it turned out not to be enough.
What steps should I take for a proper solution?
Here are some solutions I'm NOT interested in:
- "Copy the external css module to the assets folder and use it from there"
- I'm seeking a solution that integrates seamlessly with the npm package.
- "Utilize bootstrap-loader for webpack"
- As mentioned before, I am after a generic solution, where bootstrap is just being used as an example.
- "Switch to a different stack"
- I am specifically looking for a solution within the exact starter pack referenced above.