Created
October 2, 2022 17:57
-
-
Save ayyash/2ecb31ad9977e293254d26b90dde7a34 to your computer and use it in GitHub Desktop.
Rewriting Execute function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function execute( | |
options: IOptions, | |
context: BuilderContext, | |
): Promise<BuilderOutput> { | |
// read browser options and setup the clientPath | |
const browserTarget = targetFromTargetString(options.browserTarget); | |
const browserOptions = (await context.getTargetOptions(browserTarget)) as any; | |
const clientPath = path.resolve(context.workspaceRoot, browserOptions.outputPath ); | |
// and server options | |
const serverTarget = targetFromTargetString(options.serverTarget); | |
const serverOptions = (await context.getTargetOptions(serverTarget)) as any; | |
const serverPath = path.resolve(context.workspaceRoot, serverOptions.outputPath); | |
// now we do not need to schedule any builder | |
return _renderUniversal( | |
routes, | |
context, | |
// now we pass strings for paths instead of browserResult and serverResult | |
clientPath, | |
serverPath, | |
// we just need the index file from options | |
getIndexOutputFile(browserOptions), | |
// since we are dropping piscina this won't be necessary | |
// options.numProcesses | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment