Registry / devops / rollup-plugin-globlin

rollup-plugin-globlin

JSON →
library0.1.4jsnpmunverified

Rollup plugin (v0.1.4, latest stable) that provides file watching, copy, transform, repath, and rename capabilities using glob patterns. Differentiates from alternatives like rollup-plugin-copy by offering inline transformation via object or function, clean destination option, and no unnecessary dependencies. Ship TypeScript types. Low release cadence (initial release Aug 2024, no updates since). Primarily used for static asset copying with optional content modification in Rollup builds.

npm install rollup-plugin-globlin
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-GLOB
R
rollup-plugin-globlin
devopsjavascriptv0.1.4
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.

default
import globs from 'rollup-plugin-globlin'
const globs = require('rollup-plugin-globlin')
ESM-only package; no CommonJS export. Use default import.
type GlobsOptions
import type { GlobsOptions } from 'rollup-plugin-globlin'
import { GlobsOptions } from 'rollup-plugin-globlin'
Type import only; not a runtime value.
default (TypeScript)
import globs from 'rollup-plugin-globlin'
import * as globs from 'rollup-plugin-globlin'
Default import works in TS with esModuleInterop. Namespace import may cause runtime error.

Copies SVG files from assets/ to dist/assets/, transforms content to uppercase, renames extension to .SVG, and cleans destination before copy.

import globs from 'rollup-plugin-globlin'; import { defineConfig } from 'rollup'; export default defineConfig({ input: 'src/index.js', output: { dir: 'dist', format: 'cjs', }, plugins: [ globs({ globs: ['assets/**/*.svg'], dest: 'dist/assets', clean: true, transform: { '**/*.svg': ({ content }) => ({ content: content.toString().toUpperCase(), file: '[name].SVG', }), }, }), ], });
Debug
Known issues
breakingv0.1.0 to v0.1.1: function signature for transform callback may change
fix
Upgrade to v0.1.1 and adapt transform callback to accept an object with { content, file, dest } properties.
affects: <0.1.1
deprecatedtransform object key 'dest' is deprecated in favor of returning object with 'dest' property
fix
Always return { content, file, dest } from transform function or object; dest key in transform config object is ignored.
affects: >=0.1.0
gotchatransform function must return an object with 'content' as string or a string. Returning a Buffer causes runtime error.
fix
Ensure content is a string, e.g., content.toString() if needed.
affects: >=0.1.0
gotchaif transform returns a string without slash, it renames the file; with slash, it repaths relative to dest. Misunderstanding leads to unexpected output.
fix
Review transform documentation: string without slash = rename, string with slash = repath from dest.
affects: >=0.1.0
gotchaclean: true removes the dest directory before copying; if dest is a parent directory of project files, data loss may occur.
fix
Use clean: true with caution; avoid setting dest to root or important project directories.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: globs is not a function
Using CommonJS require to import an ESM-only package.
fix
Use import (ESM) instead: import globs from 'rollup-plugin-globlin'
Error: transform must return a string or object
transform callback returns undefined or non-string/object.
fix
Ensure transform returns a string or an object with content property (string).
Error: Cannot find module 'rollup-plugin-globlin'
Package not installed or version does not exist.
fix
Run: pnpm add rollup-plugin-globlin --save-dev
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

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