-
-
Save rredpoppy/cf8a11f62e90b9f551e523303cabcb45 to your computer and use it in GitHub Desktop.
Bootstrap and Browserify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bfy-bootstrap-test", | |
"version": "0.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "beefy index.js --live" | |
}, | |
"author": "David Guttman <[email protected]> (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" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment