Registry / devops / rollup-plugin-tla

rollup-plugin-tla

JSON →
library0.0.2jsnpmunverified

A Rollup plugin that enables top-level await (TLA) support for IIFE and UMD output formats, which Rollup does not natively support. Version 0.0.2 adds TypeScript declarations and supports Node.js >=14.18. It works by transforming the output to use a dynamic import or wrapper to handle TLA. Differentiators: lightweight, no additional runtime dependencies, and specifically targets IIFE/UMD where Rollup's own TLA handling is absent.

npm install rollup-plugin-tla
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-TLA
R
rollup-plugin-tla
devopsjavascriptv0.0.2
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 tla from 'rollup-plugin-tla'
const tla = require('rollup-plugin-tla')
ESM-only package; CJS require will fail.
tla
import tla from 'rollup-plugin-tla'
import { tla } from 'rollup-plugin-tla'
Package exposes a default export only, not a named export.
Plugin type (TypeScript)
import type { Plugin } from 'rollup'; import tla from 'rollup-plugin-tla'; const plugin: Plugin = tla();
import tla from 'rollup-plugin-tla'; const plugin = tla(); // works but no type safety
The package includes TypeScript declarations; the default export is typed as a Rollup plugin.

Shows how to add top-level await support for IIFE output format using rollup-plugin-tla.

import tla from 'rollup-plugin-tla'; export default { input: 'src/index.js', output: { format: 'iife', file: 'dist/bundle.js' }, plugins: [ tla() ] };
Debug
Known issues
gotchaPlugin only works for IIFE and UMD formats; for ESM or CJS, Rollup natively supports TLA and this plugin is unnecessary.
fix
Ensure output format is 'iife' or 'umd'.
affects: >=0.0.0
gotchaThe plugin transforms the output to use a dynamic import or wrapper; this may cause side effects if not used carefully with other plugins that manipulate the AST.
fix
Test the bundle thoroughly with your specific plugin chain.
affects: >=0.0.0
deprecatedPackage has not been updated since early 2023; compatibility with newer Rollup versions (>=3) is not guaranteed.
fix
Consider alternative approaches or test with Rollup v3+.
affects: >=0.0.0
Errors
Common errors & fixes
Error: [object Object] is not a Rollup plugin
Using a named import instead of default import leads to the plugin object being malformed.
fix
Change import { tla } from 'rollup-plugin-tla' to import tla from 'rollup-plugin-tla'.
${tla} is not a function
Trying to use require() in an ESM-only context – require returns the module object, not the plugin function.
fix
Use import instead of require.
Top-level await is not supported in the configured output format
Output format is not IIFE or UMD; Rollup fails natively.
fix
Set output.format to 'iife' or 'umd'.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
rollup-plugin-tla — npm install rollup-plugin-tla · libregistry