Registry / devops / rollup-plugin-bower-resolve

rollup-plugin-bower-resolve

JSON →
library3.1.0jsnpmunverified

A Rollup plugin that resolves module imports using the Bower resolution algorithm, allowing Rollup to bundle Bower components. Version 3.1.0 is the latest stable release, supporting Rollup v1 through v4 and Node >=14. Unlike npm-centric plugins, this plugin is specifically designed for projects that still rely on Bower for dependency management. It offers options for offline mode, custom working directories, and overrides for main entry points. The plugin is in maintenance mode as the Bower ecosystem has largely been superseded by npm/Yarn.

npm install rollup-plugin-bower-resolve
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-BOWE
R
rollup-plugin-bower-resolve
devopsjavascriptv3.1.0
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default
import bowerResolve from 'rollup-plugin-bower-resolve'
const bowerResolve = require('rollup-plugin-bower-resolve')
Package is ESM-only since version 3.0.0. CommonJS require will fail.
bowerResolve
const bowerResolve = require('rollup-plugin-bower-resolve').default
const bowerResolve = require('rollup-plugin-bower-resolve')
If forced to use CommonJS, must access .default property.
Plugin
import type { Plugin } from 'rollup'; import bowerResolve from 'rollup-plugin-bower-resolve';
TypeScript definitions are included; plugin returns Rollup Plugin object.

Shows a complete Rollup build using the plugin with Bower resolution and CommonJS support.

import { rollup } from 'rollup'; import bowerResolve from 'rollup-plugin-bower-resolve'; import commonjs from '@rollup/plugin-commonjs'; const bundle = await rollup({ input: 'src/index.js', plugins: [ bowerResolve({ cwd: process.cwd(), offline: true, module: true, jsnext: true, skip: ['some-big-dependency'] }), commonjs() ] }); await bundle.write({ file: 'dist/bundle.js', format: 'iife', name: 'MyBundle' }); console.log('Bundle created successfully.');
Debug
Known issues
breakingVersion 3.0.0 dropped support for Node <14.0.0 and switched to ESM-only exports.
fix
Update Node to >=14.0.0 and use import syntax instead of require.
affects: >=3.0.0
deprecatedThe 'jsnext' option is deprecated; use 'module' instead.
fix
Set module: true and jsnext: false to future-proof.
affects: >=0.5.0
gotchaThe 'offline' option defaults to true, which may cause build failures if Bower cache is not populated.
fix
Set offline: false to fetch from remote, or ensure bower install has been run.
affects: >=0.4.0
breakingVersion 2.0.0 requires Rollup 2.x.x and Node >=10.0.0; Rollup 1.x no longer supported.
fix
Upgrade Rollup to >=2.0.0 and Node to >=10.0.0.
affects: >=2.0.0
breakingVersion 1.0.0 removed support for Rollup versions below 1.0.0 and Node <6.0.0.
fix
Upgrade Rollup to >=1.0.0 and Node to >=6.0.0.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-bower-resolve'
Package is ESM-only starting from v3.0.0; using require() in a CommonJS context fails.
fix
Switch to import syntax: import bowerResolve from 'rollup-plugin-bower-resolve'
TypeError: bowerResolve is not a function
Using require() in Node.js without .default access.
fix
Use const bowerResolve = require('rollup-plugin-bower-resolve').default;
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
bowerrequiredRuntime peer dependency; Bower must be installed globally or locally for plugin to function.
rolluprequiredPeer dependency; plugin hooks into Rollup's resolveId mechanism.
Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-bower-resolve — npm install rollup-plugin-bower-resolve · libregistry