Skip to content

Instantly share code, notes, and snippets.

@davidguttman
Last active February 29, 2024 21:43
Show Gist options
  • Select an option

  • Save davidguttman/1f61ab59349cb99d28a1 to your computer and use it in GitHub Desktop.

Select an option

Save davidguttman/1f61ab59349cb99d28a1 to your computer and use it in GitHub Desktop.
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"
]
}
}
@ldong

ldong commented Aug 16, 2015

Copy link
Copy Markdown

This works for me. Thanks.

@fmagrosoto

Copy link
Copy Markdown

Excelent... thanks!!

@peterbarraud

Copy link
Copy Markdown

Does anybody get this error:

Cannot find module 'rijs.resdir'

@peterbarraud

Copy link
Copy Markdown

Sorry guys please ignore the question. Problemo fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment