Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 448a2d8

Browse files
committed
Remove "ambient module" augmentation check
1 parent dca49eb commit 448a2d8

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/lib/compile.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,6 @@ function stringifyDependencyPath (path: string, options: StringifyOptions): Prom
309309

310310
const importedFiles = info.importedFiles.map(x => resolveFromWithModuleName(resolved, x.fileName))
311311
const referencedFiles = info.referencedFiles.map(x => resolveFrom(resolved, x.fileName))
312-
const moduleAugmentations = (info.ambientExternalModules || []).map(x => resolveFromWithModuleName(resolved, x))
313-
const ambientModules = moduleAugmentations.filter(x => importedFiles.indexOf(x) === -1)
314-
315-
if (ambientModules.length && !ambient) {
316-
return Promise.reject(new TypingsError(
317-
`Attempted to compile "${options.name}" as a dependency, but ` +
318-
`it contains some ambient module declarations ` +
319-
`(${ambientModules.map(JSON.stringify).join(', ')}).`
320-
))
321-
}
322312

323313
// All dependencies MUST be imported for ambient modules.
324314
if (ambient) {
@@ -333,11 +323,6 @@ function stringifyDependencyPath (path: string, options: StringifyOptions): Prom
333323
return
334324
}
335325

336-
// Support inline ambient module declarations.
337-
if (ambientModules.indexOf(path) > -1) {
338-
return
339-
}
340-
341326
// Set the file to "already imported" to avoid duplication.
342327
options.imported[path] = true
343328

0 commit comments

Comments
 (0)