MCPcopy
hub / github.com/rollup/rollup / requireOrImport

Function requireOrImport

cli/run/commandPlugins.ts:115–122  ·  view source on GitHub ↗
(pluginPath: string)

Source from the content-addressed store, hash-verified

113}
114
115async function requireOrImport(pluginPath: string): Promise<any> {
116 try {
117 // eslint-disable-next-line @typescript-eslint/no-require-imports
118 return require(pluginPath);
119 } catch {
120 return import(pluginPath);
121 }
122}

Callers 1

loadAndRegisterPluginFunction · 0.85

Calls 1

requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…