fix(web): fix handling of buildLibsFromSource: false in dev-server executor (#9326)
* modify buildOptions.tsConfig before creating Webpack config * do not join buildOptions.tsConfig to root path as it is already an absolute path
This commit is contained in:
parent
75f9ece440
commit
dff05dcbde
@ -1,7 +1,6 @@
|
||||
import * as webpack from 'webpack';
|
||||
import {
|
||||
ExecutorContext,
|
||||
joinPathFragments,
|
||||
parseTargetString,
|
||||
readTargetOptions,
|
||||
} from '@nrwl/devkit';
|
||||
@ -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,
|
||||
@ -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 }) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user