Skip to content

Commit

Permalink
fix(core): Ensure require('nx') to resolve correctly
Browse files Browse the repository at this point in the history
closes: #19782
  • Loading branch information
ndcunningham committed Oct 23, 2023
1 parent cc8d8e8 commit 2a5a867
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function executeModuleFederationDevServerBuilder(
schema: Schema,
context: import('@angular-devkit/architect').BuilderContext
): ReturnType<typeof executeWebpackDevServerBuilder | any> {
const nxBin = require.resolve('nx');
const nxBin = require.resolve('nx/bin/nx');
const { ...options } = schema;
const projectGraph = readCachedProjectGraph();
const { projects: workspaceProjects } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default async function* moduleFederationDevServer(
options: ModuleFederationDevServerOptions,
context: ExecutorContext
): AsyncIterableIterator<{ success: boolean; baseUrl?: string }> {
const nxBin = require.resolve('nx');
// Force Node to resolve to look for the nx binary that is inside node_modules
const nxBin = require.resolve('nx/bin/nx');
const currIter = options.static
? fileServerExecutor(
{
Expand Down

0 comments on commit 2a5a867

Please sign in to comment.