Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 5 .changeset/weak-parents-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Output esbuild metafile, can be inspected after `deploy --dry run`
24 changes: 18 additions & 6 deletions 24 packages/cli-v3/src/build/buildWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ export async function buildWorker(options: BuildWorkerOptions) {
? rewriteBuildManifestPaths(buildManifest, options.destination)
: buildManifest;

await writeDeployFiles(buildManifest, resolvedConfig, options.destination);
await writeDeployFiles({
buildManifest,
resolvedConfig,
outputPath: options.destination,
bundleResult,
});
}

return buildManifest;
Expand Down Expand Up @@ -140,11 +145,17 @@ function rewriteOutputPath(destinationDir: string, filePath: string) {
}
}

async function writeDeployFiles(
buildManifest: BuildManifest,
resolvedConfig: ResolvedConfig,
outputPath: string
) {
async function writeDeployFiles({
buildManifest,
resolvedConfig,
outputPath,
bundleResult,
}: {
buildManifest: BuildManifest;
resolvedConfig: ResolvedConfig;
outputPath: string;
bundleResult: BundleResult;
}) {
// Step 1. Read the package.json file
const packageJson = await readProjectPackageJson(resolvedConfig.packageJsonPath);

Expand Down Expand Up @@ -176,6 +187,7 @@ async function writeDeployFiles(
});

await writeJSONFile(join(outputPath, "build.json"), buildManifestToJSON(buildManifest));
await writeJSONFile(join(outputPath, "metafile.json"), bundleResult.metafile);
await writeContainerfile(outputPath, buildManifest);
}

Expand Down
2 changes: 2 additions & 0 deletions 2 packages/cli-v3/src/build/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type BundleResult = {
contentHash: string;
files: TaskFile[];
configPath: string;
metafile: esbuild.Metafile;
loaderEntryPoint: string | undefined;
runWorkerEntryPoint: string | undefined;
runControllerEntryPoint: string | undefined;
Expand Down Expand Up @@ -297,6 +298,7 @@ export async function getBundleResultFromBuild(
indexControllerEntryPoint,
initEntryPoint,
contentHash: hasher.digest("hex"),
metafile: result.metafile,
};
}

Expand Down
3 changes: 0 additions & 3 deletions 3 packages/cli-v3/src/dev/backgroundWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export class BackgroundWorker {
throw new Error("Worker already initialized");
}

// Write the build manifest to this.build.outputPath/build.json
await writeJSONFile(this.buildManifestPath, this.build, true);

logger.debug("indexing worker manifest", { build: this.build, params: this.params });

this.manifest = await indexWorkerManifest({
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.