Registry / web-framework / bootstrap-loader

bootstrap-loader

JSON →
library4.0.5jsnpmunverified

Webpack loader to bundle Bootstrap 3 & 4 styles (Sass) and scripts. Version 4.0.5, last updated 2018; low maintenance. Supports Bootstrap 4 with customizations via .bootstraprc. Differentiators: inline SVG/PNG glyphicons, Tether integration, PostCSS config. Full peer dependencies required: css-loader, sass-loader, mini-css-extract-plugin, webpack >=5.0.

npm install bootstrap-loader
INSTALL
IMPORT
SIG · BOOTSTRAP-LOADER
B
bootstrap-loader
web-frameworkjavascriptv4.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bootstrap-loader
import 'bootstrap-loader'
const bootstrap = require('bootstrap-loader')
Side-effect only loader, no exports. Use import or require for side effects.
bootstrap-loader/lib/loader
import 'bootstrap-loader/lib/loader'
import { something } from 'bootstrap-loader/lib/loader'
Internal path may break; prefer the main entry.
bootstrap-loader/no-op
import 'bootstrap-loader/no-op'
Stub for SSR or tests where Bootstrap is not needed.

Minimal webpack config to load Bootstrap via bootstrap-loader and separate custom SCSS.

// webpack.config.js module.exports = { module: { rules: [ { test: /bootstrap-loader[\\\/]lib[\\\/]bootstrap-sass$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'sass-loader' } ] }, { test: /\.scss$/, exclude: /bootstrap-loader[\\\/]lib[\\\/]bootstrap-sass$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'sass-loader' } ] } ] }, plugins: [ new HtmlWebpackPlugin({ template: 'src/index.html' }) ] }; // src/index.js import 'bootstrap-loader'; import './styles/main.scss';
Debug
Known issues
breakingBootstrap 4 requires Bootstrap 4's JavaScript dependencies (jQuery, Popper.js) to be separately loaded. bootstrap-loader does not bundle jQuery.
fix
Add ProvidePlugin for jQuery and Popper.js, or use Bootstrap 4 JS via another method.
affects: =4.x
breakingWebpack versions: v4 requires webpack >=5.0. Older versions (v1–v3) used different loaders/config.
fix
Upgrade webpack to >=5.0.0, or pin bootstrap-loader@3.x for webpack v4.
affects: =4.x
breakingmini-css-extract-plugin peer dependency requires webpack 5; for webpack 4 use extract-text-webpack-plugin with bootstrap-loader v3.
fix
Use webpack >=5 or downgrade to bootstrap-loader@3.x with proper extract-text-webpack-plugin version.
affects: =4.x
deprecatedbootstrap-loader v4 is no longer actively maintained. Upstream Bootstrap itself moved to Bootstrap 5 with separate JS modules.
fix
Consider migrating to direct Bootstrap imports or a modern alternative like bootstrap (official npm package) with webpack.
affects: >=4.0
gotchaIf using Bootstrap 4 glyphicons, bootstrap-loader expects to resolve SVG/PNG files; missing loaders cause 'Module not found' errors.
fix
Add file-loader or url-loader for fonts/images, and set proper paths in .bootstraprc.
affects: >=3.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'bootstrap-loader'
Missing dependency on bootstrap-loader or incorrect webpack config.
fix
npm install bootstrap-loader --save-dev and ensure it's listed in webpack entry or imported.
Cannot find module 'mini-css-extract-plugin'
Required peer dependency not installed.
fix
npm install mini-css-extract-plugin --save-dev (for webpack 5).
SassError: Undefined variable: "$icon-font-path"
Bootstrap's glyphicon paths not configured.
fix
Set $icon-font-path in your .bootstraprc pre-customizations or import Bootstrap variables before glyphicons.
Upgrade
Version history
4.0.5latest on npm
Audit
Dependencies
css-loaderrequiredrequired for CSS processing
mini-css-extract-pluginrequiredextract CSS in production builds
sass-loaderrequiredcompile Sass files
webpackrequiredcore bundler
Agent activity
8 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
bootstrap-loader — npm install bootstrap-loader · libregistry