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-rebase

v4.1.1

Published

The Rollup Rebase Plugin copies static assets as required from your JavaScript code to the destination folder and adjusts the references in there to point to the new location.

Downloads

8,139

Readme

Rollup Rebase Sponsored by Version Downloads Build Status

The Rollup Rebase Plugin copies static assets as required from your JavaScript code to the destination folder and adjusts the references in there to point to the new location. It also respects assets referenced from your CSS/SCSS files.

Features

  • Copies over asset files references from JavaScript into the given output folder.
  • Adjust asset references in the output JavaScript files to map to the relative new location.
  • Transforms CSS files to inline all includes from @import via PostCSS Import into the origin files.
  • Detects and processes assets referenced from both, JavaScript and CSS.
  • Renames all assets based on their hash (XXHash + Base62) so that conflicts are automatically eliminated while producing a flat output structure.
  • Supports normal CSS, but also SugarSS, SCSS and Sass via the standard PostCSS parser plugins.

Comparison

The plugin is meant as a tool for preparing a library for being published. In this it differs from plugins like Rollup URL Plugin as it is designed for usage in libraries and not for applications. The output of this plugin can be used by tools like Webpacks File Loader, URL Loader or the already mentioned Rollup URL Plugin.

Installation

$ npm install --save-dev rollup-plugin-rebase

or

$ yarn add --dev rollup-plugin-rebase

Usage

You can configure Rollup Rebase as part of your Rollup configuration. This can be either done in a rollup.config.js or by scripting using the Rollup API:

import { rollup } from "rollup"
import rebasePlugin from "rollup-plugin-rebase"

async function config() {
  const bundle = await rollup({
    input: "./src/index.js",
    plugins: [rebasePlugin()]
  })

  await bundle.write({
    dest: "./lib/index.js"
  })
}

config()

Options (all optional)

  • assetFolder: When set assets are placed inside a sub folder with that name.
  • keepName: If true, generated filenames will be ${filename}~${hash}.${ext} instead of just ${hash}.${ext}
  • verbose: If true, increases log level
  • include: Standard include option for rollup plugins.
  • exclude: Standard exclude option for rollup plugins.

Copyright

Copyright 2016-2022Sebastian Software GmbH