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

@smvgdev/vite-plugin-shopify-assets-sweep

v1.0.3

Published

Sweeps away stale Vite build artifacts from the Shopify assets folder, preserving static files via a static-assets manifest.

Readme

🧹 vite-plugin-shopify-assets-sweep

A Vite plugin that cleans up stale assets from your Shopify theme's assets/ folder based on the current Vite manifest — while preserving static files defined in a static-assets manifest. Ideal for keeping your Shopify repo clean and deploy-ready without clutter from old build artifacts. This was build with the Shopify Paper theme in mind, but should work with any Shopify theme that uses Vite.


✨ Features

  • ✅ Automatically removes outdated hashed build files
  • ✅ Preserves files you define in static-assets.json
  • ✅ Supports dryRun mode for safe previewing
  • ✅ Works with Shopify’s assets/ theme directory
  • ✅ Runs during both buildStart and writeBundle phases

📦 Installation

npm install vite-plugin-shopify-assets-sweep --save-dev

🚀 Usage

In your vite.config.ts:

import shopify from "vite-plugin-shopify";
import shopifyAssetsSweep from "vite-plugin-shopify-assets-sweep";

export default {
  plugins: [
    shopify({
      sourceCodeDir: "src",
      entrypointsDir: "src/entrypoints",
      snippetFile: "assets.liquid",
    }),
    shopifyAssetsSweep({
      manifestFileName: "assets/manifest.json",
      staticManifestFileName: "static-assets.json",
      dryRun: false,
    }),
  ],
  build: {
    emptyOutDir: false,
  },
};

🧾 static-assets.json

Place this file in the root of your project. It should list all the static assets you want to preserve, even if they aren’t in the current Vite manifest:

["logo.svg", "mezereon.js", "mezereon.css.liquid"]

These filenames should match what's in the assets/ folder exactly.


⚙️ Options

| Option | Type | Default | Description | | ------------------------ | --------- | ------------------------ | ----------------------------------------------------------- | | manifestFileName | string | "assets/manifest.json" | Path to the Vite-generated manifest file | | themeRoot | string | "assets" | Directory containing your Shopify theme assets | | staticManifestFileName | string | "static-assets.json" | Path to JSON file listing static assets to preserve | | dryRun | boolean | false | If true, logs deletions but doesn't actually remove files |


🧪 Dry Run Mode

Want to preview what would be deleted?

shopifyAssetsSweep({
  dryRun: true,
});

This will output logs like:

[Dry Run] buildStart: Would delete old-script-abc123.js
[Dry Run] writeBundle: Would delete legacy-style-def456.css

No files are removed during dry run.


🛠 Example Project Structure

.
├── assets/
│   ├── main-abc123.js
│   ├── old-main-def456.js  ← will be deleted
│   ├── logo.svg            ← preserved via static-assets.json
│   └── manifest.json       ← current Vite manifest
├── src/
│   └── ...
├── static-assets.json   ← list of static assets to preserve
├── vite.config.ts

📄 License

MIT — feel free to use, modify, and contribute.


💬 Feedback / Contributions

If you find this helpful or have suggestions, feel free to open an issue or PR. Happy sweeping! 🧹