@ngrok/mantle-vite-plugins weekly downloads statistics
By ngrok (2 listings) · npm · Vite plugins
Vite plugins for @ngrok/mantle.
@ngrok/mantle-vite-plugins has 8,880 recorded weekly downloads on npm, a decrease of 6.3% over the past 30 days, ranking #1319 of 3,247 tracked listings.
About @ngrok/mantle-vite-plugins
@ngrok/mantle-vite-plugins
Vite plugins for apps built with @ngrok/mantle. The docs page is
mantle.ngrok.com/vite-plugins.
Requirements
- Node.js 26 LTS
- Vite 8.3 or later
@ngrok/mantleinstalled in the same project
Installation
pnpm add -D -E @ngrok/mantle-vite-plugins
Tailwind sources
Mantle ships source-all.css, a single @source that covers every component in the package. Import it next to mantle.css in your global CSS:
@import "@ngrok/mantle/mantle.css";
@import "@ngrok/mantle/source-all.css";
To trim the production stylesheet to the components the bundle contains, add mantleSourcesPlugin to vite.config.ts. The CSS stays as above.
Earlier versions of this package shipped mantleTwSourcePlugin, which injected per-component @source directives. It was removed because its source scan missed files in some setups and produced incomplete CSS. If you used it, remove the mantleTwSourcePlugin import and its call from vite.config.ts, delete the generated block between the /* @ngrok/mantle-vite-plugins:source:start */ and :end markers in your global CSS, and add the source-all.css import above.
Plugins
mantleSourcesPlugin(options?)
Vite plugin that narrows mantle's Tailwind scan to the files the client bundle contains. Add it next to the Tailwind plugin; the position in the array does not matter.
import { mantleSourcesPlugin } from "@ngrok/mantle-vite-plugins";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [tailwindcss(), mantleSourcesPlugin()],
});
In vite dev the plugin is inactive, so source-all.css scans every mantle JavaScript file. Tailwind styles every component the app can reach. In vite build, in the client environment, the plugin reads the bundler's module graph. It replaces the source-all.css import with @source directives for the @ngrok/mantle files the graph holds, chunks and dynamic imports included. That is one @source per directory, plus an @source not for every neighbor outside the graph. The build logs one line:
mantle sources: 6 @ngrok/mantle files listed for src/app.css (source-all.css scans 248)
After the bundle is final, the plugin compares the list with every chunk. If the bundle holds a mantle file the CSS does not list, the build fails and names the file and one of two causes. Either another plugin added a chunk after the CSS transform ran: move that plugin's emit earlier. Or the wait for the module graph gave up before a slow module parsed: raise idleTimeoutMs. In both cases onMiss: "warn" logs the miss and ships the CSS without those classes instead. The server build gets no rewrite. When one vite build --app run also builds the server and bundles mantle into it (ssr.noExternal), the plugin warns about a mantle file that only the server graph reaches. Such a component has no classes in the client CSS. The @source not lines apply to every @source that walks the same directory. A directory @source of your own that overlaps mantle's files loses the same neighbors.
The source-all.css import must sit in a CSS file Vite processes. An import chain that Tailwind resolves on its own is invisible to the plugin.
The plugin also runs mantleThemePrunePlugin, so you do not add it yourself. Pass themePrune: false to turn it off.
Options
| Option | Type | Default | Description |
|---|---|---|---|
onMiss | "error" | "warn" | "error" | What the build does when the client bundle holds a mantle or include file the CSS does not list. "error" fails the build; "warn" logs the file. |
include | string[] | [] | Package names whose reached files the plugin lists too. Use it for a component package that sets Tailwind classes on mantle parts. |
verbose | boolean | false | Print every listed path. |
idleTimeoutMs | number | 15000 | How long the CSS waits with no module event before it lists the files parsed so far. When one module, such as a ?worker sub-build, takes longer, raise it; Infinity waits for events only. |
themePrune | boolean | true | Whether the build also runs mantleThemePrunePlugin. Pass false when a file outside the stylesheet reads palette stops that the stylesheet does not, such as CSS another app serves. |
mantleThemePrunePlugin()
Vite plugin that removes the mantle theme CSS a production build does not read. mantleSourcesPlugin runs it for you. Add it on its own only when your build does not use mantleSourcesPlugin.
import { mantleThemePrunePlugin } from "@ngrok/mantle-vite-plugins";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [tailwindcss(), mantleThemePrunePlugin()],
});
```…
Description from the npm listing.
- mantle
- ngrok
- shiki
- tailwindcss
- vite
- vite-plugin
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (135)Similar npm Vite plugins plugins
All 20 @ngrok/mantle-vite-plugins alternativesData 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/@ngrok/mantle-vite-plugins. First seen Nov 17, 2026; last successful collection Dec 6, 2026. See the methodology.