├── app ├── bootstrap.config.less └── bootstrap.config.js ├── webpackOptions.js ├── templates.json ├── index.js ├── bootstrap-scripts.loader.js ├── bootstrap-styles.loader.js └── template.json /app/bootstrap.config.less: -------------------------------------------------------------------------------- 1 | // Modify bootstrap variables here. 2 | 3 | // a example: 4 | // @bodyBackground: @grayLighter; -------------------------------------------------------------------------------- /webpackOptions.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | module.exports = function(options) { 3 | options.resolve.alias.bootstrap = __dirname; 4 | } -------------------------------------------------------------------------------- /templates.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "defaultVersion": "2.2.1", 4 | "base": "..", 5 | "versions": { 6 | "2.1.1": "v2.1.1", 7 | "2.2.1": "v2.2.1" 8 | } 9 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require("style!css!val?cacheable!less!./bootstrap-styles!../../../app/bootstrap.config"); 2 | var jQuery = require("jquery"); 3 | require("./bootstrap-scripts!../../../app/bootstrap.config"); 4 | module.exports = jQuery; -------------------------------------------------------------------------------- /bootstrap-scripts.loader.js: -------------------------------------------------------------------------------- 1 | var scripts = [ 2 | "affix", 3 | "alert", 4 | "button", 5 | "carousel", 6 | "collapse", 7 | "dropdown", 8 | "modal", 9 | "tooltip", 10 | "popover", 11 | "scrollspy", 12 | "tab", 13 | "transition", 14 | "typeahead" 15 | ]; 16 | 17 | module.exports = function(configSource) { 18 | this.cacheable(); 19 | var config = this.exec(configSource, this.filenames[0]); 20 | return scripts.filter(function(script) { 21 | return config.scripts[script]; 22 | }).map(function(script) { 23 | return "require(" + JSON.stringify("bootstrap/" + script) + ");"; 24 | }).join("\n"); 25 | } -------------------------------------------------------------------------------- /bootstrap-styles.loader.js: -------------------------------------------------------------------------------- 1 | var styles = [ 2 | "mixins", 3 | "scaffolding", 4 | "grid", 5 | "layouts", 6 | "type", 7 | "code", 8 | "forms", 9 | "tables", 10 | "sprites", 11 | "dropdowns", 12 | "wells", 13 | "component-animations", 14 | "close", 15 | "buttons", 16 | "button-groups", 17 | "alerts", 18 | "navs", 19 | "navbar", 20 | "breadcrumbs", 21 | "pagination", 22 | "pager", 23 | "media", 24 | "modals", 25 | "tooltip", 26 | "popovers", 27 | "thumbnails", 28 | "labels-badges", 29 | "progress-bars", 30 | "accordion", 31 | "carousel", 32 | "hero-unit", 33 | "responsive-utilities", 34 | "responsive-767px-max", 35 | "responsive-768px-979px", 36 | "responsive-1200px-min", 37 | "responsive-navbar", 38 | "utilities" 39 | ]; 40 | 41 | module.exports = function(configSource) { 42 | this.cacheable(); 43 | var config = this.exec(configSource, this.filenames[0]); 44 | var start = config.styles.reset ? "@import \"~bootstrap/less/reset.less\";\n" : ""; 45 | start += "@import \"~bootstrap/less/variables.less\";\n"; 46 | start += '@iconSpritePath: "~bootstrap/img/glyphicons-halflings.png";\n'; 47 | start += '@iconWhiteSpritePath: "~bootstrap/img/glyphicons-halflings-white.png";\n'; 48 | start += "@import \"bootstrap.config.less\";\n"; 49 | return start + styles.filter(function(style) { 50 | return config.styles[style]; 51 | }).map(function(style) { 52 | return "@import \"~bootstrap/less/" + style + ".less\";"; 53 | }).join("\n"); 54 | } -------------------------------------------------------------------------------- /app/bootstrap.config.js: -------------------------------------------------------------------------------- 1 | // executed while compiling by the bootstrap wpt-module 2 | // to get the (by-default) required bootstrap scripts and styles 3 | // you can ever require("bootstrap/xxx"), i.e. require("bootstrap/affix") 4 | // to include more scripts, that are not included by default 5 | 6 | // modify to your wishes 7 | module.exports = { 8 | scripts: { 9 | affix: true, 10 | alert: true, 11 | button: true, 12 | carousel: true, 13 | collapse: true, 14 | dropdown: true, 15 | modal: true, 16 | popover: true, 17 | scrollspy: true, 18 | tab: true, 19 | tooltip: true, 20 | transition: true, 21 | typeahead: true 22 | }, 23 | styles: { 24 | accordion: true, 25 | alerts: true, 26 | breadcrumbs: true, 27 | "button-groups": true, 28 | buttons: true, 29 | carousel: true, 30 | close: true, 31 | code: true, 32 | "component-animations": true, 33 | dropdowns: true, 34 | forms: true, 35 | grid: true, 36 | "hero-unit": true, 37 | "labels-badges": true, 38 | layouts: true, 39 | mixins: true, 40 | media: true, 41 | modals: true, 42 | navbar: true, 43 | navs: true, 44 | pager: true, 45 | pagination: true, 46 | popovers: true, 47 | "progress-bars": true, 48 | "responsive-1200px-min": true, 49 | "responsive-767px-max": true, 50 | "responsive-768px-979px": true, 51 | "responsive-navbar": true, 52 | "responsive-utilities": true, 53 | scaffolding: true, 54 | sprites: true, 55 | tables: true, 56 | thumbnails: true, 57 | tooltip: true, 58 | type: true, 59 | utilities: true, 60 | wells: true 61 | } 62 | } -------------------------------------------------------------------------------- /template.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "version": "2.2.1", 4 | "dependencies": { 5 | "jquery": "1.8.1" 6 | }, 7 | "dependencyPaths": { 8 | "jquery": "https://raw.github.com/webpack/jquery-wpt-module/master" 9 | }, 10 | "files": { 11 | "app/bootstrap.config.js": 1, 12 | "app/bootstrap.config.less": 1 13 | }, 14 | "moduleFiles": { 15 | "index.js": true, 16 | "webpackOptions.js": true, 17 | "bootstrap-scripts.loader.js": true, 18 | "bootstrap-styles.loader.js": true, 19 | "img": { 20 | "directory": true, 21 | "than": { 22 | "glyphicons-halflings.png": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/img/glyphicons-halflings.png"}, 23 | "glyphicons-halflings-white.png": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/img/glyphicons-halflings-white.png"} 24 | } 25 | }, 26 | "affix.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-affix.js"}, 27 | "alert.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-alert.js"}, 28 | "button.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-button.js"}, 29 | "carousel.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-carousel.js"}, 30 | "collapse.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-collapse.js"}, 31 | "dropdown.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-dropdown.js"}, 32 | "modal.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-modal.js"}, 33 | "popover.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-popover.js"}, 34 | "scrollspy.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-scrollspy.js"}, 35 | "tab.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-tab.js"}, 36 | "tooltip.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-tooltip.js"}, 37 | "transition.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-transition.js"}, 38 | "typeahead.js": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/js/bootstrap-typeahead.js"}, 39 | "less": { 40 | "directory": true, 41 | "than": { 42 | "accordion.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/accordion.less"}, 43 | "alerts.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/alerts.less"}, 44 | "bootstrap.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/bootstrap.less"}, 45 | "breadcrumbs.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/breadcrumbs.less"}, 46 | "button-groups.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/button-groups.less"}, 47 | "buttons.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/buttons.less"}, 48 | "carousel.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/carousel.less"}, 49 | "close.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/close.less"}, 50 | "code.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/code.less"}, 51 | "component-animations.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/component-animations.less"}, 52 | "dropdowns.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/dropdowns.less"}, 53 | "forms.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/forms.less"}, 54 | "grid.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/grid.less"}, 55 | "hero-unit.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/hero-unit.less"}, 56 | "labels-badges.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/labels-badges.less"}, 57 | "layouts.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/layouts.less"}, 58 | "media.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/media.less"}, 59 | "mixins.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/mixins.less"}, 60 | "modals.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/modals.less"}, 61 | "navbar.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/navbar.less"}, 62 | "navs.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/navs.less"}, 63 | "pager.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/pager.less"}, 64 | "pagination.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/pagination.less"}, 65 | "popovers.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/popovers.less"}, 66 | "progress-bars.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/progress-bars.less"}, 67 | "reset.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/reset.less"}, 68 | "responsive-1200px-min.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive-1200px-min.less"}, 69 | "responsive-767px-max.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive-767px-max.less"}, 70 | "responsive-768px-979px.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive-768px-979px.less"}, 71 | "responsive-navbar.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive-navbar.less"}, 72 | "responsive-utilities.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive-utilities.less"}, 73 | "responsive.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/responsive.less"}, 74 | "scaffolding.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/scaffolding.less"}, 75 | "sprites.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/sprites.less"}, 76 | "tables.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/tables.less"}, 77 | "thumbnails.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/thumbnails.less"}, 78 | "tooltip.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/tooltip.less"}, 79 | "type.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/type.less"}, 80 | "utilities.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/utilities.less"}, 81 | "variables.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/variables.less"}, 82 | "wells.less": { "overwrite": true, "file": "https://raw.github.com/twitter/bootstrap/v2.2.1/less/wells.less"} 83 | } 84 | } 85 | } 86 | } 87 | 88 | 89 | --------------------------------------------------------------------------------