vite-plugin-plain-text weekly downloads statistics
By zheeeng · npm · Vite plugins
A Vite plugin transforms the rule-matched file as plain text.
vite-plugin-plain-text has 9,040 recorded weekly downloads on npm, an increase of 8.5% over the past 30 days, ranking #1311 of 3,247 tracked listings.
About vite-plugin-plain-text
vite-plugin-plain-text
A Vite plugin that transforms matched files into plain text.
Installation
pnpm i -D vite-plugin-plain-text (or npm/yarn)
Usage Example
Assume we are going to transform these files:
- The project's
LICENSEfile - Textbox
.glslfile
into plain text.
// vite.config.(t|j)s
import { defineConfig } from 'vite';
import plainText from 'vite-plugin-plain-text';
export default defineConfig({
plugins: [
// passing regular expression or glob matcher
plainText([/\/LICENSE$/, '**/*.text', /\.glsl$/]),
],
});
// component.js
import { plainText as LICENSE } from '../LICENSE'
import { plainText as Lorem } from '../lorem-ipsum.text'
import { plainText as Siren } from '../siren.glsl'
console.log(LICENSE)
console.log(Lorem)
console.log(Siren)
Advanced Usage
Options Reference
type PlainTextOptions = {
namedExport?: string | false,
dtsAutoGen?: boolean,
distAutoClean?: boolean,
}
Enable Default Export
Use the plainTextOptions.namedExport option to configure the named exported variable. To enable the default export, pass false, '', or undefined.
// vite.config.(t|j)s
import { defineConfig } from 'vite';
import plainText from 'vite-plugin-plain-text';
export default defineConfig({
plugins: [
plainText(
[/\/LICENSE$/, '**/*.text', /\.glsl$/],
{ namedExport: false },
),
],
});
// component.js
import LICENSE from '../LICENSE'
import Lorem from '../lorem-ipsum.text'
import Siren from '../siren.glsl'
console.log(LICENSE)
console.log(Lorem)
console.log(Siren)
Type Safety
Adding Module Declarations Manually
// vite-env.d.ts
declare module '*/LICENSE' {
export const plainText: string
}
declare module '*.text' {
export const plainText: string
}
declare module '*.glsl' {
export const plainText: string
}
Generate the declaration automatically
plainTextOptions.dtsAutoGengenerates.dtsfiles for matched files.plainTextOptions.dtsAutoCleancleans up these.dtsfiles after the vite plugin starts up each time.
import { defineConfig } from 'vite';
import plainText from 'vite-plugin-plain-text';
export default defineConfig({
plugins: [
plainText(
[/\/LICENSE$/, '**/*.text', /\.glsl$/],
{ namedExport: false, dtsAutoGen: true, distAutoClean: true },
),
],
});
License
MIT
Alternative
Virtual asset Loader: vite-plugin-virtual-plain-text
Description from the npm listing.
- vite
- plugin
- vite-plugin
- plain text
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 (170)Similar npm Vite plugins plugins
All 20 vite-plugin-plain-text 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/vite-plugin-plain-text. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.
