FountainJS / generator-fountain-webapp

Yeoman 'fountain' generator to start a webapp
http://fountainjs.io
MIT License
967 stars 67 forks source link

Installing Bootstrap 4 #180

Open IdanCo opened 7 years ago

IdanCo commented 7 years ago

I've installed bootstrap 4 in my fountain project, and it was much harder than i've anticipated, so i thought i'd share the recipe for those who follow.

start with installing the required modules - npm install bootstrap@4.0.0-alpha.6 tether jquery --save

require bootstrap js through index.js - import 'bootstrap';

require bootstrap sass through index.sass - @import "~bootstrap/scss/bootstrap.scss";

and here comes the weird part: add this to the plugin section in each webpack.conf file -

    new webpack.ProvidePlugin({
      $: "jquery",
      jQuery: "jquery",
      "window.jQuery": "jquery",
      "Tether": "tether"
    }),

I'm using ng1, but i'm sure this could be beneficial to other setups as well. If anyone knows of a better or simpler way - please let me know.

heshamelmasry77 commented 6 years ago

thank you