vega-frontend-monorepo/tools/executors/next/export/impl.ts
Matthew Russell 5666b8f8e4
chore: add custom export executor for next app (#1999)
* chore: add custom export executor for next app

* chore: update tsconfig path for export executor
2022-11-08 18:59:49 -08:00

23 lines
633 B
TypeScript

import type { ExecutorContext } from '@nrwl/devkit';
import setup from '../../../utils/setup-environment';
import nextExportExecutor from '@nrwl/next/src/executors/export/export.impl';
import { NextExportBuilderOptions } from '@nrwl/next/src/utils/types';
type Schema = NextExportBuilderOptions & {
env: string;
};
export default async function exportWithEnv(
options: Schema,
context: ExecutorContext
) {
const { env, ...nextOptions } = options;
await setup(env, context, 'tools/executors/next/export');
try {
return await nextExportExecutor(nextOptions, context);
} catch (err) {
console.error(err);
}
}