public void Export(Stream outStream, PlatformExportManifest manifest, Action<ExportImportProgressInfo> progressCallback) { if (manifest == null) { throw new ArgumentNullException("manifest"); } using (var package = ZipPackage.Open(outStream, FileMode.Create)) { //Export all selected platform entries ExportPlatformEntriesInternal(package, manifest, progressCallback); //Export all selected modules ExportModulesInternal(package, manifest, progressCallback); //Write system information about exported modules var manifestPart = package.CreatePart(_manifestPartUri, "application/javascript"); //After all modules exported need write export manifest part using (var stream = manifestPart.GetStream()) { manifest.SerializeJson<PlatformExportManifest>(stream); } } }