(target)
| 27 | } |
| 28 | |
| 29 | async function writeSeaConfig(target) { |
| 30 | await mkdir(nativeIntermediatesDir(), { recursive: true }); |
| 31 | const { manifest, manifestJson, assets } = await collectNativeAssets({ |
| 32 | appRoot, |
| 33 | target, |
| 34 | }); |
| 35 | const web = await collectWebAssets({ appRoot, target }); |
| 36 | const manifestPath = resolve(nativeManifestDir(target), 'manifest.json'); |
| 37 | const webManifestPath = resolve(nativeIntermediatesDir(), 'web-assets', target, 'manifest.json'); |
| 38 | await mkdir(dirname(manifestPath), { recursive: true }); |
| 39 | await mkdir(dirname(webManifestPath), { recursive: true }); |
| 40 | await writeFile(manifestPath, manifestJson); |
| 41 | await writeFile(webManifestPath, web.manifestJson); |
| 42 | |
| 43 | const seaAssets = { |
| 44 | [nativeAssetManifestKey(target)]: manifestPath, |
| 45 | [webAssetManifestKey(target)]: webManifestPath, |
| 46 | ...assets, |
| 47 | ...web.assets, |
| 48 | }; |
| 49 | const config = { |
| 50 | main: nativeJsBundlePath(), |
| 51 | output: nativeBlobPath(), |
| 52 | assets: Object.fromEntries( |
| 53 | Object.entries(seaAssets).sort(([a], [b]) => a.localeCompare(b)), |
| 54 | ), |
| 55 | disableExperimentalSEAWarning: true, |
| 56 | useCodeCache: false, |
| 57 | useSnapshot: false, |
| 58 | }; |
| 59 | await writeFile(nativeSeaConfigPath(), `${JSON.stringify(config, null, 2)}\n`); |
| 60 | |
| 61 | console.log(`Collected native assets for ${manifest.target}:`); |
| 62 | for (const line of nativeAssetSummary(manifest)) { |
| 63 | console.log(`- ${line}`); |
| 64 | } |
| 65 | console.log( |
| 66 | `Collected web assets for ${web.manifest.target}: ${web.manifest.files.length} files`, |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | export async function runSeaBlobStep() { |
| 71 | await ensureBundleExists(); |
no test coverage detected