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

@robmarr/nollup

v0.6.0

Published

Rollup-compatible bundler for development.

Downloads

3

Readme

Nollup

Build Status NPM Version License

Rollup compatible bundler, designed to be used in development, while Rollup is used to generate a production build.

Motivation

  • Rollup is excellent, but during development it can be a bit slow as it's performing unnecessary build steps (tree-shaking).
  • When making changes to files, Rollup has to recompile the entire bundle due to the tree-shaking optimisations. This can lead to slow rebuild times.
  • Wanted something similar to Webpack development flow, but with the simplicity of the Rollup configuration and plugin ecosystem.
  • To give developers a foundation for implementing Hot Module Replacement when using Rollup.
  • While Rollup does have watching functionality, it writes to disk and isn't intended to be used in-memory.

What does this do?

  • Nollup doesn't attempt to do any optimisations, it simple concatenates all of the modules together with simple function wrappers.
  • ES6 import and export statements are detected and replaced with an internal module loader.
  • Each module is wrapped in an eval call with source maps.
  • Compatible with Rollup plugins, so you can use one single Rollup configuration for both development and production. Make sure the plugin uses emitAsset instead of writing to disk.
  • Detects changed files, and performs a rebuild and has support for Hot Module Replacement.

Examples

See examples directory on how to use.

CLI

Nollup provides a dev server which can be used as a CLI command.

    "scripts": {
        "start": "nollup -c"
    }

See "Nollup Options" for list of available flags.

.nolluprc

Configuration file that can be used to pass configuration instead of as flags through the CLI.

{
    "hot": true,
    "contentBase": "./public"
}

A JavaScript file called .nolluprc.js can be used instead.

module.exports = {
    hot: true,
    contentBase: './public'
};

See "Nollup Options" for list of available options.

Nollup Options

  • String config | -c | --config [file] - Pass a configuration file. By default it will look for rollup.config.js but can be specified otherwise.
  • String contentBase | --content-base [folder] - Folder to serve static content from. By default it will be looking in './.
  • Boolean historyApiFallback | --history-api-fallback - If set, it will fallback to index.html if accessing a route that doesn't exist.
  • Boolean hot | --hot - Enable Hot Module Replacement.
  • Number port | --port [value] - Port number to run server on. Default is 8080.
  • Boolean verbose | --verbose - If set, there's verbose logging.
  • Object proxy - Object keys are paths to match. Value is domain to redirect to. "/api": "http://localhost:8080" will have a request such as /api/todos redirect to http://localhost:8080/api/todos

API

See API for information on how to use the JavaScript API.

Rollup Plugins with Nollup Enhancements

Caveats

  • Not all Rollup configuration options are supported yet.
  • Not all Rollup plugin hooks are implemented yet.
  • Sourcemaps aren't perfect yet, depends on plugin usage.
  • Does not attempt to parse "require" calls anywhere.
  • No support for live-bindings. Not sure if I want to sacrifice debugging capabilities for a feature not used often.
  • No support for circular imports.

Contributions are welcome.