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

@pain-org/rollup

v1.4.0

Published

``` yarn add @pain-org/rollup ```

Downloads

6

Readme

@pain-org/rollup

 yarn add @pain-org/rollup

pain-rollup build --help

eg: pain-rollup build -f cjs -v true -s true
eg: pain-rollup build -f "cjs,es,umd" -v true
Usage: build [options]

Options:
  -t --target <value>                       Specify Target File (default: "./src/index.ts")
  -f --format <amd,cjs,es,iife,umd,system>  Build specified formats (default: ["es","cjs"])
  -rc --pain-config <item>                  config file of pain-rollup. i.e pain.config.ts
  -d --declaration <true|false>             Generates corresponding .d.ts file (default: true)
  -o --output <item>                        Generate source map (default: "dist")
  -c --compress <true|false>                Compress or minify the output (default: true)
  -s --sourcemap <true|false>               Generate source map (default: false)
  -w --web <true|false>                     Instructs the plugin to use the browser module resolutions (default: false)
  -v --visualizer <true|false>              Visualize and analyze your Rollup bundle to see which modules are taking up space. (default: false)
  -r --resolve <true|false>                 Resolve dependencies (default: false)
  -p --preserve-modules <true|false>        Keep directory structure and files (default: false)
  -h, --help                                display help for command

pain-rollup watch --help

Watch rebuilds your bundle when it detects that the individual modules have changed on disk.

eg: pain-rollup watch -f cjs -v true -s true
eg: pain-rollup watch -f "cjs,es,umd" -v true
Usage: build [options]

Options:
  -t --target <value>                       Specify Target File (default: "./src/index.ts")
  -f --format <amd,cjs,es,iife,umd,system>  Build specified formats (default: ["es","cjs"])
  -rc --pain-config <item>                  config file of pain-rollup. i.e pain.config.ts
  -d --declaration <true|false>             Generates corresponding .d.ts file (default: true)
  -o --output <item>                        Generate source map (default: "dist")
  -c --compress <true|false>                Compress or minify the output (default: true)
  -s --sourcemap <true|false>               Generate source map (default: false)
  -w --web <true|false>                     Instructs the plugin to use the browser module resolutions (default: false)
  -v --visualizer <true|false>              Visualize and analyze your Rollup bundle to see which modules are taking up space. (default: false)
  -r --resolve <true|false>                 Resolve dependencies (default: false)
  -p --preserve-modules <true|false>        Keep directory structure and files (default: false)
  -h, --help                                display help for command

bundling can control with pain.config.ts file on root folder

import { Plugin } from 'rollup'
import { PainCustomConfigInterface, PackageInfoInterface } from '@pain-org/rollup'
import { RollupNodeResolveOptions } from "@rollup/plugin-node-resolve";

export const painConfig = async (pkgInfo: PackageInfoInterface, tagetPath: string): Promise<PainCustomConfigInterface> => {
    return <PainCustomConfigInterface>{
        replace: {
            //search and replace,
        },
        resolveOptions: async (option: RollupNodeResolveOptions) => {

            return option;
        }
        plugins: (list: (Plugin | null | false | undefined)[]) => {
            // modifiy plugins add/remove and return the list
            return list
        },
        callbacks: {
            // onComplete: async() => {},
            // onStart: async() => {},
        },
        // copy: [{ source: 'README.md' }, { source: 'tsconfig.json', target: './config/tsconfig.json' }],
        // watch: {}, //additional watch configuration (https://rollupjs.org/guide/en/#watchoptions)
    }
}

Default Search and replace

{
    __buildDate__: "Replaces With Current Date"
    __buildVersion__: "Replaces with package.json version"
    __git_hash__: "Replaces with your last commit id from the current branch"
    __git_branch__: "Replaces with your current branch"
}