How to Change Version of Bootstrap?

  1. Remove Bootstrap from web/static/css/phoenix.css.
  2. npm install --save-dev bootstrap@4.0.0-alpha.5
  3. Update brunch-config.js:
npm: {
  // Add this.
  styles: {
    bootstrap: ["dist/css/bootstrap.css"]
  }
}

If you’d like to use Bootstrap’s JavaScript you also have to:

  1. npm install --save-dev jquery
  2. Update brunch-config.js:
modules: {
  autoRequire: {
    // Add "jquery".
    "js/app.js": ["jquery", "web/static/js/app"]
  }
},
npm: {
  // Add this.
  globals: {"jQuery": "jquery"}
}

This is required to make jQuery available to Bootstrap’s JavaScript.

Hope it helps. :slight_smile:

7 Likes