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-config-badger-den

v1.5.0

Published

Configurable rollup plugin/template for bundling FVTT modules.

Downloads

131

Readme

What is the Badger Den?

A configurable Rollup plugin designed for easy bundling and packaging of FoundryVTT modules. Built with flexibility in mind -- let the Badger Den make your life easier.

Why Use the Badger Den?

Rapid Development

Using Rollup's watch mode and FoundryVTT's "hot module reload" system allows for more time coding and styling, and less time creating builds and reloading. Note, JS files are not currently compatible with FVTT's default HMR system, but are watched, re-bundled on change, and latched by Foundry on a browser refresh.

Multiple Build Profiles

Create different build configurations for various develeopment activities, such debug, test, and release; all using the same source code. Include additional development or debug JS modules without worry of accidental inclusion in the release bundle.

Compendium Extraction and Compilation

Manage compendium/database sources and optionally compile to, or extract from, human-readable source files and LevelDB/Foundry compatible compendium databases.

Source Structure Flexibility

Your code; your rules. Between file discovery via fast-glob and Rollup's own magic, the Den is happy with whatever file structure you use.

Stylesheet Bundling and Compilation

Supports Sass scss and standard css files with results bundled into a single css file, with appropriate module manifest entries. Simply import the stylesheet into your JS entry point, or any other relevant JS file. Dependent stylesheets will be automatically discovered and bundled as required.

External Module Support

Include browser-compatible utilities or libraries sourced from NPM packages or third party sources easily and without hassle.

Installation

npm init
npm install -D rollup-config-badger-den

Setup

The primary component of using the Badger Den is the "bd" config file, which contains the information and configurations for producing the output module bundle.

Den Config File

File location defines the module's root. File name must end in .bd.json. If an id field is not provided in the file, the preceding base name of config file will be used.

  • E.g. src/my-module.bd.json

See Den Config Definition for full explation of each required and optional field in this file.

Example Config File

NPM Scripts

Executing the bundling/packaging process is most easily done via an entry in your package.json's scripts field.

For example:

{"develop": "rollup -c node:rollup-config-badger-den --config-den src/my-module:dev"}

Using the above, the build would be started with npm run develop, where develop is the name given to the script entry and :dev indicates to use the dev profile defined in the my-module.bd.json file located in the src/ folder, which is the root of the module.

Additional Arguments

-w | --watch Enable Rollup's watch mode, recompiling on changes.

--config-pack [only] Compile LevelDB compendiums during build. If only is used (e.g. --config-pack only), this bundling operation will only pack the defined compendia paths, rather than both packing compendia and bundling module code. Note, due to optional only argument, --config-pack/unpack must be the last configuration argument provided to Rollup.

--config-unpack [only] Extract LevelDB binary compendiums to human-readable source files. See --config-pack for only usage notes.

These arguments can be added directly to the npm script entry, or passed along from the command line. Note, when passing via the command line, the arguments must be seperated by -- from the rest of the npm script command, as seen in the example below.

npm run develop -- -w --config-pack