Skip to content
PluginStats

tw-plugin-webpack weekly downloads statistics

By playforge-coding · npm · Webpack plugins

Bundle a multi-file TurboWarp/Scratch extension into a single unsandboxed-extension file with webpack or Rspack.

View on npm Fresh · Oct 27, 2026 · data Jul 1, 2026

tw-plugin-webpack has 17 recorded weekly downloads on npm.

Weekly downloads
17
Official API · Jul 1, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
—
Among tracked npm listings

About tw-plugin-webpack

tw-plugin-webpack

Write a TurboWarp / Scratch extension across as many files as you like, then let webpack or Rspack bundle it into the single self-contained file TurboWarp expects.

A normal TurboWarp extension is one file wrapped in an IIFE that registers itself:

(function (Scratch) {
  'use strict';
  class MyExtension {
    /* getInfo() + block methods */
  }
  Scratch.extensions.register(new MyExtension());
})(Scratch);

That's fine for a toy, but it means everything — every block, helper, and constant — has to live in one file. This plugin lets you split the extension into real ES modules and produces exactly that IIFE for you, with Scratch.extensions.register(...) wired up automatically.

How it works

Point your bundler at an entry module that export defaults the extension class (or instance). The plugin:

  1. Configures the build to emit a single self-executing file whose entry export is captured in a local variable.
  2. Wraps the whole bundle in the standard (function (Scratch) { … })(Scratch) template.
  3. Appends Scratch.extensions.register(new YourExtension()).

Because the entire bundle lives inside the IIFE, every bare reference to the Scratch global in your code binds to the local parameter — the "personal copy of the Scratch API" the TurboWarp docs recommend. No import of Scratch is needed (or possible); it's a host global, just like in a hand-written extension.

Install

npm install -D tw-plugin-webpack
# plus whichever bundler you use:
npm install -D @rspack/core   # or: npm install -D webpack webpack-cli

Usage

Split your extension however you like:

// src/blocks/greeting.js
export const greet = (name) => `Hello, ${name}!`;
// src/index.js — the entry. Default-export the class; do NOT call register().
import { greet } from './blocks/greeting.js';

export default class MyExtension {
  getInfo() {
    return {
      id: 'myextension',
      name: 'My Extension',
      blocks: [
        {
          opcode: 'hello',
          blockType: Scratch.BlockType.REPORTER,
          text: 'greet [WHO]',
          arguments: {
            WHO: { type: Scratch.ArgumentType.STRING, defaultValue: 'world' },
          },
        },
      ],
    };
  }
  hello(args) {
    return greet(args.WHO);
  }
}
Rspack
// rspack.config.js
import { TurboWarpExtensionPlugin } from 'tw-plugin-webpack';

export default {
  mode: 'production',
  target: 'web',
  devtool: false, // single pasteable file — source maps just bloat it
  entry: './src/index.js',
  output: {
    path: new URL('./dist', import.meta.url).pathname,
    filename: 'my-extension.js',
  },
  plugins: [new TurboWarpExtensionPlugin({ name: 'My Extension' })],
};
webpack

Identical — it's a standard plugin. const { TurboWarpExtensionPlugin } = require('tw-plugin-webpack') and drop it in plugins. The plugin touches no bundler-specific internals (it goes through compiler.webpack), so the same config shape works for both.

Build it, then load dist/my-extension.js in TurboWarp via add extension → Custom Extension, or serve it and use ?extension=<url>.

Options

OptionTypeDefaultDescription
metadataobject—Registry header injected as // Name: / // ID: / … comment lines (see below).
inlineAssetsboolean | RegExptrueInline imported assets (svg/png/…) as base64 data: URIs so import icon from './icon.svg' works (see below). RegExp to customize, false to disable.
registerbooleantrueAppend the Scratch.extensions.register(...) call. Set false to call register() yourself inside your code.
unsandboxedbooleanfalseEmit a guard that throws unless the extension runs unsandboxed (Scratch.extensions.unsandboxed).
namestringmetadata.nameName used in the unsandboxed-guard error message. Falls back to metadata.name, then "This extension".
libraryExportstring | string[]"default"Which export of the entry module is the extension. Use a named export instead of the default if you prefer.
varNamestring"__turbowarpExtension__"Internal identifier the export is assigned to before registration. Change only on an unlucky name collision.

register accepts either a class (it's instantiated with new) or an already-constructed instance (registered as-is).

Submitting to the gallery

The TurboWarp extensions gallery requires a metadata header — a block of // Key: Value comments at the very top of the file. Pass metadata and the plugin emits it above the IIFE:…

Description from the npm listing.

  • turbowarp
  • scratch
  • extension
  • webpack
  • webpack-plugin
  • rspack
  • rspack-plugin
  • bundler

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

tw-plugin-webpack weekly downloads on npm, last 90 days: 17 weekly downloads as of Jul 1, 2026.tw-plugin-webpackWeekly downloads on npm · Last 90 days17downloads / weekNo observations recorded in this periodno observations · 0 observations · Updated Jul 1, 2026pluginstats.com
tw-plugin-webpack weekly downloads on npm, last 90 days: 17 weekly downloads as of Jul 1, 2026.

7/30/90-day growth

tw-plugin-webpack weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.tw-plugin-webpackWeekly downloads growth on npm17downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Jul 1, 2026pluginstats.com
tw-plugin-webpack weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

tw-plugin-webpack has no ranking history on npm yet.tw-plugin-webpacknpm ranking · by weekly downloads · Last 90 daysNo ranking observations in this periodno observations · 0 observations · Updated Jul 1, 2026pluginstats.com
tw-plugin-webpack has no ranking history on npm yet.

Listing placement

All npm2,577 listings · 129 pages · 1,289 shown · page 112, #1 (overall #2,221)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins267 listings · 14 pages · page 10, #15 (overall #195)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (1)
Recent weekly downloads observations for tw-plugin-webpack
Date (UTC)Weekly downloadsChange vs. previous
17—

Similar npm Webpack plugins plugins

All 20 tw-plugin-webpack alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/tw-plugin-webpack. First seen Oct 27, 2026; last successful collection Oct 27, 2026. See the methodology.