vega-frontend-monorepo/tools/executors/next/build/impl.ts
2022-09-05 15:25:33 +01:00

23 lines
666 B
TypeScript

import type { ExecutorContext } from '@nrwl/devkit';
import setup from '../../../utils/setup-environment';
import nextBuildExecutor from '@nrwl/next/src/executors/build/build.impl';
import { NextBuildBuilderOptions } from '@nrwl/next/src/utils/types';
type Schema = NextBuildBuilderOptions & {
env?: string;
};
export default async function build(
options: Schema,
context: ExecutorContext
): Promise<ReturnType<typeof nextBuildExecutor>> {
const { env, ...nextOptions } = options;
await setup(env, context, 'tools/executors/next/build');
try {
return await nextBuildExecutor(nextOptions, context);
} catch (err) {
console.error(err);
}
}