Skip to content

Commit

Permalink
fix(web): fix handling of buildLibsFromSource: false in dev-server ex…
Browse files Browse the repository at this point in the history
…ecutor (#9326)

* modify buildOptions.tsConfig before creating Webpack config
* do not join buildOptions.tsConfig to root path as it is already an absolute path
  • Loading branch information
ms-tng committed Mar 18, 2022
1 parent 75f9ece commit dff05dc
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions packages/web/src/executors/dev-server/dev-server.impl.ts
@@ -1,7 +1,6 @@
import * as webpack from 'webpack';
import {
ExecutorContext,
joinPathFragments,
parseTargetString,
readTargetOptions,
} from '@nrwl/devkit';
Expand Down Expand Up @@ -51,6 +50,23 @@ export default async function* devServerExecutor(
context.root,
sourceRoot
);

if (!buildOptions.buildLibsFromSource) {
const { target, dependencies } = calculateProjectDependencies(
readCachedProjectGraph(),
context.root,
context.projectName,
'build', // should be generalized
context.configurationName
);
buildOptions.tsConfig = createTmpTsConfig(
buildOptions.tsConfig,
context.root,
target.data.root,
dependencies
);
}

let webpackConfig = getDevServerConfig(
context.root,
projectRoot,
Expand All @@ -71,22 +87,6 @@ export default async function* devServerExecutor(
});
}

if (!buildOptions.buildLibsFromSource) {
const { target, dependencies } = calculateProjectDependencies(
readCachedProjectGraph(),
context.root,
context.projectName,
'build', // should be generalized
context.configurationName
);
buildOptions.tsConfig = createTmpTsConfig(
joinPathFragments(context.root, buildOptions.tsConfig),
context.root,
target.data.root,
dependencies
);
}

return yield* eachValueFrom(
runWebpackDevServer(webpackConfig, webpack, WebpackDevServer).pipe(
tap(({ stats }) => {
Expand Down

0 comments on commit dff05dc

Please sign in to comment.