Skip to content

Commit

Permalink
Merge pull request #12 from saevarma/main
Browse files Browse the repository at this point in the history
Adding outfile property to the response of buildExecutor
  • Loading branch information
sindrig committed Sep 20, 2021
2 parents f734cff + 715857a commit 94e92ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/esbuildnx/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import { format } from 'date-fns';
import { inspect } from 'util';
import { copyPackages, getPackagesToCopy } from '../../utils/walk-packages';
import { copyAssets } from '../../utils/assets';
import { OUTFILE_NAME } from '../../utils/constants';
import { NodeBuildEvent } from '@nrwl/node/src/executors/build/build.impl';

export function buildExecutor(
rawOptions: BuildExecutorSchema,
context: ExecutorContext
): AsyncIterableIterator<{ success: boolean }> {
): AsyncIterableIterator<NodeBuildEvent> {
const { sourceRoot, root } = context.workspace.projects[context.projectName];

if (!sourceRoot) {
Expand Down Expand Up @@ -54,6 +56,7 @@ export function buildExecutor(
);

const outdir = `${options.outputPath}`;
const outfile = `${outdir}/${OUTFILE_NAME}`;

const watchDir = `${options.root}/${options.sourceRoot}`;

Expand Down Expand Up @@ -223,6 +226,7 @@ export function buildExecutor(
console.log(buildResults.message);
return {
success: buildResults?.success && tscResults?.success,
outfile,
};
})
)
Expand Down Expand Up @@ -260,6 +264,7 @@ export function buildExecutor(
tscResults?.success &&
packageCopyResults.success &&
assetCopyResults.success,
outfile,
};
}
)
Expand Down
1 change: 1 addition & 0 deletions packages/esbuildnx/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const OUTFILE_NAME = 'main.js'

0 comments on commit 94e92ca

Please sign in to comment.