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
muslnode 18–223 runs
build_error
glibcnode 18–223 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'
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-raw'
Plugin not installed or missing from node_modules.
fixRun '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.
fixUse 'import raw from 'rollup-plugin-raw'' (default import).
Audit
Dependencies
No dependency data recorded yet.