npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rollup-plugin-bower-resolve

v3.1.0

Published

Use the bower resolution algorithm with Rollup

Downloads

146

Readme

rollup-plugin-bower-resolve

Greenkeeper badge Build Status CI Npm version

Locate modules using the bower resolution algorithm for using third party modules in your bower component directory.

Installation

npm install --save-dev rollup-plugin-bower-resolve

Usage

import { rollup } from 'rollup';
import bowerResolve from 'rollup-plugin-bower-resolve';

rollup({
  entry: 'main.js',
  plugins: [
    bowerResolve({
      // The working directory to use with bower (i.e the directory where
      // the `bower.json` is stored).
      // Default is `process.cwd()`.
      cwd: '/tmp',

      // Use `bower` offline.
      // Default is `true`.
      offline: false,

      // Use "module" field for ES6 module if possible, default is `true`.
      // See: https://github.com/rollup/rollup/wiki/pkg.module
      module: true,

      // Use "jsnext:main" field for ES6 module if possible, default is `true`.
      // This field should not be used, use `module` entry instead, but it is `true`
      // by default because of legacy packages.
      // See: https://github.com/rollup/rollup/wiki/jsnext:main
      jsnext: true,

      // if there's something your bundle requires that you DON'T
      // want to include, add it to 'skip'
      skip: [ 'some-big-dependency' ],  // Default: []

      // Override path to main file (relative to the module directory).
      override: {
        lodash: 'dist/lodash.js'
      }
    })
  ]
}).then( bundle => bundle.write({ dest: 'bundle.js', format: 'iife' }) );

This plugin may be used with rollup-plugin-commonjs to support non ES6 module:

import { rollup } from 'rollup';
import bowerResolve from 'rollup-plugin-bower-resolve';
import commonjs from 'rollup-plugin-commonjs';

rollup({
  entry: 'main.js',
  plugins: [
    bowerResolve(),
    commonjs()
  ]
}).then(bundle => bundle.write({
  dest: 'bundle.js',
  moduleName: 'MyModule',
  format: 'iife'
})).catch(err => console.log(err.stack));

Changelog

  • 3.1.0
    • Add support for rollup ^4.0.0
  • 3.0.0
    • Add support for rollup ^3.0.0
    • Remove support for node < 14
  • 2.0.1
    • Add engines field in package.json file.
  • 2.0.0
    • Add support for rollup 2.x.x
    • Remove support for node < 10.0.0
  • 1.0.1
    • Add engines field in package.json file.
  • 1.0.0
    • Remove support for rollup < 1.0.0.
    • Remove support for node < 6.0.0
  • 0.6.0
    • Dependency updates.
  • 0.5.0
    • Fix importing main entry point when it is located in a sub directory.
    • Dependency updates.
  • 0.4.0
    • Fix offline mode (and add options to disable offline).
    • Add cwd option.
    • Fix transitive dependency resolution.
  • 0.3.0
    • Add module option
    • Add jsnext option
  • 0.2.0
    • List dependencies once

License

MIT