fix(react): ssr should serve correctly and e2e should function (#17725)
This commit is contained in:
parent
1fcba1a43a
commit
fffd84c3aa
@ -9,8 +9,8 @@ import {
|
||||
} from '@nx/devkit';
|
||||
import { daemonClient } from 'nx/src/daemon/client/client';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { join } from 'path';
|
||||
import * as path from 'path';
|
||||
import { join } from 'path';
|
||||
|
||||
import { InspectType, NodeExecutorOptions } from './schema';
|
||||
import { createAsyncIterable } from '@nx/devkit/src/utils/async-iterable';
|
||||
@ -81,8 +81,10 @@ export async function* nodeExecutor(
|
||||
const tasks: ActiveTask[] = [];
|
||||
let currentTask: ActiveTask = null;
|
||||
|
||||
yield* createAsyncIterable<{ success: boolean }>(
|
||||
async ({ done, next, error }) => {
|
||||
yield* createAsyncIterable<{
|
||||
success: boolean;
|
||||
options?: Record<string, any>;
|
||||
}>(async ({ done, next, error }) => {
|
||||
const processQueue = async () => {
|
||||
if (tasks.length === 0) return;
|
||||
|
||||
@ -110,9 +112,7 @@ export async function* nodeExecutor(
|
||||
task.promise = new Promise<void>(async (resolve, reject) => {
|
||||
task.childProcess = exec(
|
||||
`npx nx run ${context.projectName}:${buildTarget.target}${
|
||||
buildTarget.configuration
|
||||
? `:${buildTarget.configuration}`
|
||||
: ''
|
||||
buildTarget.configuration ? `:${buildTarget.configuration}` : ''
|
||||
}`,
|
||||
{
|
||||
cwd: context.root,
|
||||
@ -185,7 +185,7 @@ export async function* nodeExecutor(
|
||||
resolve();
|
||||
});
|
||||
|
||||
next({ success: true });
|
||||
next({ success: true, options: buildOptions });
|
||||
});
|
||||
},
|
||||
stop: async (signal = 'SIGTERM') => {
|
||||
@ -246,8 +246,7 @@ export async function* nodeExecutor(
|
||||
|
||||
await addToQueue();
|
||||
await processQueue();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function getExecArgv(options: NodeExecutorOptions) {
|
||||
@ -284,6 +283,7 @@ function calculateResolveMappings(
|
||||
return m;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function runWaitUntilTargets(
|
||||
options: NodeExecutorOptions,
|
||||
context: ExecutorContext
|
||||
|
||||
@ -115,6 +115,7 @@ export async function setupSsrGenerator(tree: Tree, options: Schema) {
|
||||
target: 'node',
|
||||
main: `${projectRoot}/server.ts`,
|
||||
outputPath: joinPathFragments(originalOutputPath, 'server'),
|
||||
outputFileName: 'server.js',
|
||||
tsConfig: `${projectRoot}/tsconfig.server.json`,
|
||||
compiler: 'babel',
|
||||
externalDependencies: 'all',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user