Registry /
devops / rollup-plugin-drupal-interface-translations
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.
default
✓ import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations'
✗ const drupalInterfaceTranslations = require('rollup-plugin-drupal-interface-translations')
This package is ESM-only. Using require() will throw an error. Must use import syntax.
drupalInterfaceTranslations
✓ import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations'
✗ import { drupalInterfaceTranslations } from 'rollup-plugin-drupal-interface-translations'
Export is a default export, not named. Named import will result in undefined.
Plugin
✓ import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations'
✗ import { Plugin } from 'rollup-plugin-drupal-interface-translations'
TypeScript type for the plugin is exported as Plugin but users typically import default function. Only needed for type annotations.
Minimal Rollup configuration to extract Drupal interface translations from main.js, generating a .pot file in translations/ folder.
import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations';
// https://rollupjs.org/configuration-options/
export default {
input: 'main.js',
plugins: [drupalInterfaceTranslations()],
};
Debug
Known issues
breakingPackage is ESM-only. Using CommonJS require() will throw an error.fixUse import or configure Node.js to use ESM (e.g., "type": "module" in package.json).
affects: >=1.0.0
gotchaMust be added to Vite's rollupOptions.plugins, not root plugins array, or it won't execute correctly.fixWhen using Vite, define plugin inside build.rollupOptions.plugins, not in the top-level plugins array.
affects: >=1.0.0
deprecatedNo known deprecated features in current version.
Errors
Common errors & fixes
TypeError: drupalInterfaceTranslations is not a function
Using require() on ESM-only package.
fixChange to import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations'
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Same as above, require() on ESM package.
fixUse import syntax or upgrade Node to newer version with --experimental-require-module.
The plugin is not compatible with Vite if placed in root plugins array
Plugin works as Rollup plugin and must be placed under build.rollupOptions.plugins in Vite config.
fixMove plugin to build.rollupOptions.plugins array.
Audit
Dependencies
@rollup/pluginutilsrequiredUsed internally for createFilter to include/exclude files based on filterOptions.