Does anyone feel like explaining how to set bower.json
and assets/mainfest.json
to break various elements of bootstrap (or any other component) into multiple files. I have:
assets/mainfest.json
:
{
"dependencies": {
"main.js": {
"files": [
"scripts/main.js"
],
"main": true
},
"mz_filtertable.js": {
"files": [
"scripts/jquery.filtertable.mz.js"
],
"main": true
},
"ajax-mbo-add-to-classes.js": {
"files": [
"scripts/ajax-mbo-add-to-classes.js"
],
"main": true
},
"main.css": {
"files": [
"styles/main.scss"
],
"main": true
},
"admin-style.css": {
"files": [
"styles/admin-style.scss"
]
},
"modernizr.js": {
"bower": ["modernizr"]
},
"config": {
"devUrl": "http://some.localhost"
}
}
}
bower.json
:
{
"name": "mz-mindbody-api",
"version": "2.0",
"authors": [
"Mike iLL Kilmer <mike@mzoo.org>"
],
"description": "Wordpress MBO API Integration Plugin.",
"keywords": [
"mindbody",
"wordpress",
"api"
],
"license": "MIT",
"homepage": "www.mZoo.org",
"dependencies": {
"bootstrap-sass-official": "~3.3.4",
"modernizr": "~2.8.3",
"font-awesome": "~4.3.0"
},
"ignore": [
"node_modules",
"bower_components",
"test",
"tests"
],
"overrides": {
"modernizr": {
"main": "./modernizr.js"
},
"bootstrap-sass-official": {
"main": [
"./assets/stylesheets/bootstrap/mixins/_clearfix.scss",
"./assets/stylesheets/bootstrap/mixins/_grid-framework.scss",
"./assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss",
"./assets/stylesheets/bootstrap/_variables.scss",
"./assets/stylesheets/bootstrap/mixins/_grid.scss",
"./assets/stylesheets/bootstrap/mixins/_image.scss",
"./assets/stylesheets/bootstrap/_grid.scss",
"./assets/stylesheets/bootstrap/_thumbnails.scss",
"./assets/stylesheets/bootstrap/mixins/_buttons.scss",
"./assets/stylesheets/bootstrap/mixins/_clearfix.scss",
"./assets/stylesheets/bootstrap/mixins/_opacity.scss",
"./assets/stylesheets/bootstrap/_close.scss",
"./assets/stylesheets/bootstrap/mixins/_tab-focus.scss",
"./assets/stylesheets/bootstrap/mixins/_table-row.scss",
"./assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss",
"./assets/stylesheets/bootstrap/_buttons.scss",
"./assets/stylesheets/bootstrap/_modals.scss",
"./assets/stylesheets/bootstrap/_tables.scss",
"./assets/javascripts/bootstrap/button.js",
"./assets/javascripts/bootstrap/modal.js"
]
},
"font-awesome": {
"main": [
"scss/_variables.scss",
"scss/_icons.scss",
"scss/font-awesome.scss",
"fonts/FontAwesome.otf",
"fonts/fontawesome-webfont.eot",
"fonts/fontawesome-webfont.svg",
"fonts/fontawesome-webfont.ttf",
"fonts/fontawesome-webfont.woff",
"fonts/fontawesome-webfont.woff2"
]
},
"jQuery.FilterTable": {
"main": "./jquery.filtertable.js"
}
}
}
And I want to just load half of the bootstrap into main files and half into separate js
and css
to load on specific page templates. If there’s already an answer somewhere of course please point it out and if noone else answers, I’ll report my own findings later.
Thanks, Rootsies.