@wrench/roll-typescript
Version:
plugin for bundling TypeScript with support of modular output and declaration bundle
27 lines (24 loc) • 858 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
function getKeyForCompilationSettings(host, language) {
const { options, documentRegistry } = host;
const { target } = options;
if (target === options.target)
return documentRegistry.getKeyForCompilationSettings(options);
try {
options.target = language;
return documentRegistry.getKeyForCompilationSettings(options);
}
finally {
options.target = target;
}
}
exports.getKeyForCompilationSettings = getKeyForCompilationSettings;
function addFileNames(host, fileNames) {
let dirty = false;
const set = new Set(host.fileNames);
for (const fileName of fileNames)
if (set.add(host.getCanonicalFileName(fileName)))
dirty = true;
host.setFileNames([...set], true);
}
exports.addFileNames = addFileNames;