Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): fix handling of buildLibsFromSource: false in dev-server executor #9326

Merged
merged 1 commit into from Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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