Vite Raw Plugin (v1.0.2) is a plugin for Vite that transforms any file type into a string, similar to webpack's raw-loader. It is primarily used to import non-code files like Markdown as strings for further processing (e.g., with markdown-it). The plugin has a small API surface: it accepts a single option `fileRegex` to match target files. It is maintained on GitHub but has low community adoption. Unlike alternatives like `vite-plugin-raw`, it requires explicit configuration and does not support code-splitting optimizations.
npm install vite-raw-pluginVerified import paths — ran on the pinned version, not inferred.
Configures vite-raw-plugin to import .md files as strings, then use them in components.
Provide a regex that matches all file types you want to import as strings.
Use default import syntax.
No fix needed.
Run `npm install vite-raw-plugin` or `yarn add vite-raw-plugin`.
Use ESM import syntax: `import raw from 'vite-raw-plugin'`.
Ensure the plugin is added to the Vite config and the fileRegex matches the file extension.
No dependency data recorded yet.