MCPcopy
hub / github.com/rollup/rollup / addSource

Method addSource

src/Module.ts:1265–1285  ·  view source on GitHub ↗
(
		source: string,
		declaration: ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration
	)

Source from the content-addressed store, hash-verified

1263 }
1264
1265 private addSource(
1266 source: string,
1267 declaration: ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration
1268 ) {
1269 const parsedAttributes = getAttributesFromImportExportDeclaration(declaration.attributes);
1270 const existingAttributes = this.sourcesWithAttributes.get(source);
1271 if (existingAttributes) {
1272 if (doAttributesDiffer(existingAttributes, parsedAttributes)) {
1273 this.log(
1274 LOGLEVEL_WARN,
1275 logInconsistentImportAttributes(existingAttributes, parsedAttributes, source, this.id),
1276 declaration.start
1277 );
1278 }
1279 } else {
1280 this.sourcesWithAttributes.set(source, parsedAttributes);
1281 }
1282 if ((declaration as ImportDeclaration).phase === 'source') {
1283 this.sourcePhaseSources.add(source);
1284 }
1285 }
1286
1287 private getImportedJsxFactoryVariable(
1288 baseName: string,

Callers 3

addExportMethod · 0.95
addImportMethod · 0.95
renderModulesMethod · 0.80

Calls 7

logMethod · 0.95
doAttributesDifferFunction · 0.90
getMethod · 0.80
addMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected