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

@soda-gql/webpack-plugin

v0.13.0

Published

Webpack plugin for soda-gql with HMR support

Readme

@soda-gql/webpack-plugin

Webpack plugin for soda-gql with incremental rebuild and HMR support.

Installation

npm install @soda-gql/webpack-plugin
# or
yarn add @soda-gql/webpack-plugin
# or
bun add @soda-gql/webpack-plugin

Usage

webpack.config.js

const { SodaGqlWebpackPlugin } = require("@soda-gql/webpack-plugin");

module.exports = {
  plugins: [
    new SodaGqlWebpackPlugin({
      // Optional: Path to soda-gql config file
      configPath: "./soda-gql.config.ts",

      // Optional: Enable/disable the plugin (default: true)
      enabled: process.env.NODE_ENV !== "test",

      // Optional: Enable debug logging (default: false)
      debug: process.env.DEBUG === "true",
    }),
  ],

  module: {
    rules: [
      {
        test: /\.tsx?$/,
        exclude: /node_modules/,
        use: [
          // Your existing loaders (ts-loader, babel-loader, etc.)
          "ts-loader",

          // Add soda-gql loader
          {
            loader: "@soda-gql/webpack-plugin/loader",
            options: {
              // Same options as plugin
              configPath: "./soda-gql.config.ts",
            },
          },
        ],
      },
    ],
  },
};

With webpack-dev-server

The plugin automatically handles HMR (Hot Module Replacement) for soda-gql files. When a model file changes, all dependent slices and operations are automatically rebuilt.

// webpack.config.js
module.exports = {
  devServer: {
    hot: true,
  },
  plugins: [
    new SodaGqlWebpackPlugin({
      debug: true, // Enable to see rebuild logs
    }),
  ],
  // ... rest of config
};

How It Works

  1. Plugin Initialization: On beforeRun hook, the plugin initializes and builds the initial artifact.

  2. Watch Mode: On watchRun hook, the plugin:

    • Rebuilds the artifact (detects file changes automatically)
    • Computes which files are affected by the changes
    • Shares the updated artifact with the loader
  3. Loader Processing: The loader:

    • Uses the pre-built artifact from the plugin (shared state)
    • Transforms soda-gql code using the Babel plugin
    • Adds file dependencies for proper HMR propagation
  4. Internal Module Stubbing: graphql-system and inject modules (scalars, adapter) are stubbed with export {}; in the final bundle, reducing bundle size.

Options

SodaGqlWebpackPlugin Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | configPath | string | undefined | Path to soda-gql config file | | enabled | boolean | true | Enable/disable the plugin | | include | RegExp \| RegExp[] | undefined | File patterns to include | | exclude | RegExp \| RegExp[] | undefined | File patterns to exclude | | debug | boolean | false | Enable verbose logging |

Loader Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | configPath | string | undefined | Path to soda-gql config file | | enabled | boolean | true | Enable/disable the loader |

Dependency Tracking

The plugin tracks dependencies between soda-gql files:

  • Models: Base definitions (no dependencies)
  • Operations: Reference models via model.spread()

When a model file changes:

  1. The model is rebuilt
  2. All operations that use the model are rebuilt

This ensures that changes propagate correctly through the dependency chain.

License

MIT