build/lib/bundle.ts/removeDuplicateTSBoilerplate
function removeDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] {
	// Taken from typescript compiler => emitFiles
	const BOILERPLATE = [
		{ start: /^var __extends/, end: /^}\)\(\);$/ },
		{ start: /^var __assign/, end: /^};$/ },
		{ start: /^var __decorate/, end: /^};$/ },
		{ start: /^var __metadata/, end: /^};$/ },
		{ start: /^var __param/, end: /^};$/ },
		{ start: /^var __awaiter/, end: /^};$/ },
		{ start: /^var __generator/, end: /^};$/ },
	];

	destFiles.forEach((destFile) => {
		const SEEN_BOILERPLATE: boolean[] = [];
		destFile.sources.forEach((source) => {
			const lines = source.contents.split(/\r\n|\n|\r/);
			const newLines: string[] = [];
			let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE: RegExp;

			for (let i = 0; i < lines.length; i++) {
				const line = lines[i];
				if (IS_REMOVING_BOILERPLATE) {
					newLines.push('');
					if (END_BOILERPLATE!.test(line)) {
						IS_REMOVING_BOILERPLATE = false;
					}
				} else {
					for (let j = 0; j < BOILERPLATE.length; j++) {
						const boilerplate = BOILERPLATE[j];
						if (boilerplate.start.test(line)) {
							if (SEEN_BOILERPLATE[j]) {
								IS_REMOVING_BOILERPLATE = true;
								END_BOILERPLATE = boilerplate.end;
							} else {
								SEEN_BOILERPLATE[j] = true;
							}
						}
					}
					if (IS_REMOVING_BOILERPLATE) {
						newLines.push('');
					} else {
						newLines.push(line);
					}
				}
			}
			source.contents = newLines.join('\n');
		});
	});

	return destFiles;
}