dmitry-pro
4/18/2017 - 4:53 PM

Bootstrap and Browserify

Bootstrap and Browserify

// Bootstrap wants jQuery global =(
window.jQuery = $ = require('jquery')
// Bootstrap doesn't have a "main" field / export anything =(
var bootstrap = require('bootstrap/dist/js/bootstrap')

// Get Bootstrap styles with cssify
var style = require('./node_modules/bootstrap/dist/css/bootstrap.css')

var popover = document.createElement('span')
popover.innerHTML = 'I have a popover'
document.body.appendChild(popover)

$(popover).popover({ content: 'I am popover text' })
{
  "name": "bfy-bootstrap-test",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "beefy index.js --live"
  },
  "author": "David Guttman <david@guttman.io> (http://davidguttman.com/)",
  "license": "MIT",
  "dependencies": {
    "beefy": "^2.1.1",
    "bootstrap": "^3.2.0",
    "browserify": "^5.10.0",
    "cssify": "^0.6.0",
    "jquery": "^2.1.1"
  },
  "browserify": {
    "transform": [
      "cssify"
    ]
  }
}