How to include specific needed Bootstrap JS files?

Hi !

Although i read the thread that talk about this matter I can’t figure how to include specific js files (or all them even) from Bootstrap ( v4 alpha) to my Sage config files (sage version stable 8.5)

Here is what my bower.json file looks like.

    {
  "name": "sage",
  "homepage": "https://roots.io/sage/",
  "authors": [
    "Ben Word <ben@benword.com>"
  ],
  "license": "MIT",
  "private": true,
  "dependencies": {
    "bootstrap": "git://github.com/twbs/bootstrap.git#v4.0.0-alpha.6",
    "parallax.js": "^1.4.2"
  }
}

I tried to add some overrides but it returns several errors, one of them is “unexpcted token ]” ??
What code should i add to my bower file so i can add a spectific js file from Bootstrap ? :confused:

2 Likes

something like this should work:

{
  "name": "sage",
  "homepage": "https://roots.io/sage/",
  "authors": [
    "Ben Word <ben@benword.com>"
  ],
  "license": "MIT",
  "private": true,
  "dependencies": {
    "bootstrap": "git://github.com/twbs/bootstrap.git#v4.0.0-alpha.6"
  },
  "overrides": {
    "bootstrap": {
      "main": [
        "scss/_variables.scss",
        "scss/_mixins.scss",
        "scss/_custom.scss",
        "scss/_normalize.scss",
        "scss/_print.scss",
        "scss/_reboot.scss",
        "scss/_type.scss",
        "scss/_images.scss",
        "scss/_code.scss",
        "scss/_grid.scss",
        "scss/_tables.scss",
        "scss/_forms.scss",
        "scss/_buttons.scss",
        "scss/_transitions.scss",
        "scss/_dropdown.scss",
        "scss/_button-group.scss",
        "scss/_input-group.scss",
        "scss/_custom-forms.scss",
        "scss/_nav.scss",
        "scss/_navbar.scss",
        "scss/_card.scss",
        "scss/_breadcrumb.scss",
        "scss/_pagination.scss",
        "scss/_badge.scss",
        "scss/_jumbotron.scss",
        "scss/_alert.scss",
        "scss/_progress.scss",
        "scss/_media.scss",
        "scss/_list-group.scss",
        "scss/_responsive-embed.scss",
        "scss/_close.scss",
        "scss/_modal.scss",
        "scss/_tooltip.scss",
        "scss/_popover.scss",
        "scss/_carousel.scss",
        "scss/_utilities.scss",
        "js/dist/util.js",
        "js/dist/alert.js",
        "js/dist/button.js",
        "js/dist/carousel.js",
        "js/dist/collapse.js",
        "js/dist/dropdown.js",
        "js/dist/modal.js",
        "js/dist/scrollspy.js",
        "js/dist/tab.js",
        "js/dist/tooltip.js",
        "js/dist/popover.js"
      ]
    }
  }
}
2 Likes

Bootstrap v4.0.0-beta overrides:

util.js must be first, popover.js must follow tooltip.js

{
  "name": "sage",
  "homepage": "https://roots.io/sage/",
  "authors": [
    "Ben Word <ben@benword.com>"
  ],
  "license": "MIT",
  "private": true,
  "dependencies": {
    "bootstrap": "git://github.com/twbs/bootstrap.git#v4.0.0-beta"
  },
  "overrides": {
    "bootstrap": {
      "main": [
        "scss/_functions.scss",
        "scss/_variables.scss",
        "scss/_mixins.scss",
        "scss/_print.scss",
        "scss/_reboot.scss",
        "scss/_type.scss",
        "scss/_images.scss",
        "scss/_code.scss",
        "scss/_grid.scss",
        "scss/_tables.scss",
        "scss/_forms.scss",
        "scss/_buttons.scss",
        "scss/_transitions.scss",
        "scss/_dropdown.scss",
        "scss/_button-group.scss",
        "scss/_input-group.scss",
        "scss/_custom-forms.scss",
        "scss/_nav.scss",
        "scss/_navbar.scss",
        "scss/_card.scss",
        "scss/_breadcrumb.scss",
        "scss/_pagination.scss",
        "scss/_badge.scss",
        "scss/_jumbotron.scss",
        "scss/_alert.scss",
        "scss/_progress.scss",
        "scss/_media.scss",
        "scss/_list-group.scss",
        "scss/_close.scss",
        "scss/_modal.scss",
        "scss/_tooltip.scss",
        "scss/_popover.scss",
        "scss/_carousel.scss",
        "scss/_utilities.scss",
        "js/dist/util.js",
        "js/dist/alert.js",
        "js/dist/button.js",
        "js/dist/carousel.js",
        "js/dist/collapse.js",
        "js/dist/dropdown.js",
        "js/dist/modal.js",
        "js/dist/scrollspy.js",
        "js/dist/tab.js",
        "js/dist/tooltip.js",
        "js/dist/popover.js"
      ]
    }
  }
}
2 Likes