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

@pyrologic/rollup-plugin

v1.1.1

Published

A simple yet useful rollup.js plugin

Downloads

15

Readme

Pyrologic Rollup Plugin

About

The Pyrologic Rollup Plugin provides two plugins for rollup.js:

  1. a build time stamp plugin and
  2. a build info plugin;

Installation

Use you preferred package manager to install the plugin as "dev dependency".

npm example:

npm install @pyrologic/rollup-plugin --save-dev

yarn example:

yarn add @pyrologic/rollup-plugin --dev

Usage

Import the plugin in your rollup.config.js file:

import { PyrologicRollupPlugin } from "@pyrologic/rollup-plugin";

Note: It has to be a named import as shown above. Otherwise rollup will fail.

Register the provided plugins as wanted:

// get the plugin instance
const plugin = PyrologicRollupPlugin.getInstance();

// and adjust your configuration as needed
const config = {
    input: 'src/index.js',
    output: {
        file: 'dist/myproject.js',
        name: 'myProject',
        format: 'iife',
        sourcemap: true,
        plugins: [ ]
    },
    plugins: [
        plugin.timestampPlugin('My cool project'),
        plugin.infoPlugin()
    ]
}
export default config;

That's it!

Advanced

Count and write warning messages

The Pyrologic Rollup Plugin has a warning counter. You can forward any warning that rollup issues to the plugin.

To do so, extend your rollup configuration like this:

const config = {
    input: 'src/index.js',
    output: {
        // ... see above ...
    },
    plugins: [
        plugin.timestampPlugin('My cool project'),
        plugin.infoPlugin()
    ],
    onwarn ( { loc, frame, message } ) {
        plugin.onwarn( { loc, frame, message } );
    }
}

This way, every warning is prefixed by a number.

Filter warning messages

At some point rollup.js issues "Circular dependency" warnings, if two modules import each other for instance. Sometimes, this may indicate a serious error. But there are situations where these warnings are harmless yet unavoidable.

You can instruct the Pyrologic Rollup Plugin to ignore "Circular dependency" warnings. In order to do so, just initialize the plugin with an object that has the property filterCDWarning set to true:

const config = {
    input: 'src/index.js',
    output: {
        // ... see above ...
    },
    plugins: [
        plugin.timestampPlugin('My cool project'),
        // pass an object with the property "filterCDWarning" set to true
        plugin.infoPlugin( { filterCDWarning: true } )
    ],
    onwarn ( { loc, frame, message } ) {
        plugin.onwarn( { loc, frame, message } );
    }
}

Verbose output

To get more information about the build process you can instruct the Pyrologic Rollup Plugin to write a more verbose build summary. Ath the moment this is is the number of filtered out warning messages (see above).

Just set the option verboseOutput to true:

// ... see above ...
    plugins: [
        plugin.timestampPlugin('My cool project'),
        // pass an object with the properties "verboseOutput" and "filterCDWarning" set to true
        plugin.infoPlugin( { verboseOutput: true, filterCDWarning: true } )
    ],
// ... etc. ...

Note: If filterCDWarning is left at false then verboseOutput has no effect.

Summary of options

The Pyrologic Rollup Plugin recognizes the following options:

| Option name | Type | Default value | Description | | ------------| ---- | ------------- | ----------- | | verboseOutput | Boolean | false | If set to true then the plugin writes more information to the console. | | filterCDWarning | Boolean | false | If set to true then the plugin filters "Circular dependency" warnings. |

End Of Document