Closed Quayle57 closed 7 years ago
Urg, why use raw bootstrap when you have ng-bootstrap ? Way way better than that.
The entry you have, you are using the loader in there, you can't do that.
https://github.com/shakacode/bootstrap-loader
# Usage
## Simply require it:
require('bootstrap-loader');
## Or add bootstrap-loader as a module in an entry point in your webpack config (you'll need Webpack 2.1 beta and higher):
entry: [ 'bootstrap-loader', './app' ]
That's why I used it in the entry,
I don't know about ng-bootstrap, I will check it, but right now bootstrap-loader is more than enough for my needs
Weird that one. Never used it so I have no idea and right now no time to try myself.
The name is disturbing because it loads bootstrap, but it is not a Webpack loader.
Thank you anyway I will check ng-bootstrap anyway, but if someone find a solution to my probelm feel welcome to answer !
What do you need bootstrap-loader
for? I am using vanilla Bootstrap 4 in my application fine without using bootstrap-loader
and it's one less dependency :) If you need instructions for getting bootstrap (or ng-bootstrap
, which I also use) added I can post those, but I have no experience specifically with bootstrap-loader
bootstrap-loader
is useful for customizing and making a bootstrap bundle that fits exactly your needs, plus the fact that you can add the CSS prefixes for the navigators you want.
For now I added bootstrap in the vendor.ts like that:
import 'bootstrap/dist/js/bootstrap.min.js';
import 'bootstrap/dist/css/bootstrap.min.css';
But I don't know if it's the good way, I'm interested in the way you installed it but I still wish that someone could help me with bootstrap-loader
Depending on what i'm trying to accomplish. I either use https://www.npmjs.com/package/bootstrap-css-only .. importing into the vendor.ts file.
if I need more of the bootstrap utilities, I use https://www.npmjs.com/package/ngx-bootstrap
Okay I found my problem and it was in the conf of bootstrap-loader
---
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 4
# If Bootstrap version 4 is used - turn on/off flexbox model
useFlexbox: true
# Webpack loaders, order matters
styleLoaders:
- style-loader
- css-loader
- postcss-loader
- sass-loader
I needed to put style-loader as first loader here, thank you for your help !
Hello, I'm trying to use bootstrap-loader and bootstrap4 alpha 6 in this project I succeed to make a bundle out of it, but it stays in a js file and the css is not load from there.
First I installed all the packages ;
then I added the loader here:
then I configured the plugin:
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
and finally I updated the loader:
I have no error, the bundle is with vendor, polyfills and main but the CSS is not taken into account. Has someone any idea what did I do wrong ?