Registry / devops / rollup-plugin-raw

rollup-plugin-raw

JSON →
library0.0.1jsnpmunverified

Rollup plugin that transforms raw text files (e.g., .txt, .glsl, .fs) into ES modules that export the file content as a string. Current stable version is 0.0.1, requiring Node.js v14+ and Rollup v3+. Lightweight and minimal, with TypeScript type definitions included. Differentiators: simple regex-based filtering, no dependencies.

npm install rollup-plugin-raw
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-RAW
R
rollup-plugin-raw
devopsjavascriptv0.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

raw
import raw from 'rollup-plugin-raw'
import { raw } from 'rollup-plugin-raw'
Default export; named import incorrect.
raw
const raw = require('rollup-plugin-raw')
const { raw } = require('rollup-plugin-raw')
CommonJS require works for default export.
raw
import raw from 'rollup-plugin-raw'
import raw from 'rollup-plugin-raw/index.js'
Use package name, not direct file path.

Configures Rollup to import raw text files as strings using rollup-plugin-raw.

// rollup.config.js import { defineConfig } from 'rollup'; import raw from 'rollup-plugin-raw'; export default defineConfig({ input: 'src/index.js', output: { dir: 'dist', format: 'es' }, plugins: [ raw({ filter: /\.(txt|glsl|fs)$/i }) ] }); // src/test.txt hello world // src/index.js import txt from './test.txt'; console.log(txt); // 'hello world'
Debug
Known issues
gotchaPlugin requires Rollup v3.0.0+ and Node v14.0.0+. Using older versions will cause errors.
fix
Upgrade Rollup to >=3.0.0 and Node to >=14.0.0.
affects: >=0.0.0
gotchaThe plugin is extremely early (v0.0.1); API may change without major semver bump.
fix
Pin exact version and test upgrades.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-raw'
Plugin not installed or missing from node_modules.
fix
Run 'pnpm add rollup-plugin-raw -D' or 'npm install --save-dev rollup-plugin-raw'.
TypeError: raw is not a function
Using named import instead of default import.
fix
Use 'import raw from 'rollup-plugin-raw'' (default import).
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-raw — npm install rollup-plugin-raw · libregistry