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 🙏

© 2026 – Pkg Stats / Ryan Hefner

webflow-bundler

v1.1.1

Published

Bundle, Minify, and Clean JS/TS files for Webflow

Readme

webflow-bundler

A Node.js tool for bundling, minifying, and cleaning JavaScript/TypeScript code so it can be easily copy-pasted into Webflow custom code blocks and pages. Use it directly in your package.json scripts for a seamless workflow. This tool streamlines preparing modern JS/TS for Webflow, ensuring compatibility, reduced file size, and easy embedding.

Features

  • Bundle: Combines all imports and dependencies into a single file per entrypoint.
  • Minify: Produces a minified version for optimal performance.
  • HTML Wrapping: Optionally wraps output in <script>...</script> tags for direct embedding in Webflow custom code blocks.
  • Console Stripping: Optionally removes all console.* statements for cleaner production code.
  • TypeScript & JavaScript: Supports both .ts and .js source files.
  • Pretty Output: Outputs a prettified, readable version alongside the minified one.

Installation

Install as a dev dependency:

npm install --save-dev webflow-bundler

Usage

The most common way to use webflow-bundler is in your package.json scripts.

In package.json

Add a script:

{
  "scripts": {
    "bundle:webflow": "webflow-bundler --source src --output dist/js --minify --html --drop-console"
  }
}

Then run:

npm run bundle:webflow

Options

| Option | Alias | Description | | ---------------- | ----- | --------------------------------------------------------------- | | --source <dir> | -s | Source directory (default: src) | | --output <dir> | -o | Output directory (default: dist/js) | | --minify | | Also output a minified .min.js or .min.html version | | --html | | Wrap output in <script>...</script> tags (for Webflow blocks) | | --drop-console | | Remove all console.* statements from output |

Example

Bundle and minify all files in src for Webflow, outputting both pretty and minified HTML-wrapped scripts:

npm run bundle:webflow
# or, if installed globally
webflow-bundler --source src --output dist/js --minify --html --drop-console

How It Works

  • Bundles each .js/.ts file with its dependencies using esbuild.
  • Outputs both a prettified (formatted) and optionally minified version.
  • If --html is set, wraps output in <script>...</script> for easy embedding.
  • If --drop-console is set, strips all console.* calls.

Output

  • Each source file generates a bundled output in the specified output directory, preserving relative paths.
  • If --minify is used, a .min.js (or .min.html) file is also created.
  • If --html is used, output files are HTML-wrapped for direct copy-paste into Webflow.

Troubleshooting

  • Source directory does not exist: Make sure your --source directory exists and contains .js or .ts files.
  • Import errors: Currently only JS/TS imports are supported. Other asset types like CSS, images, etc. will cause a build error.

License

MIT