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 * as webpack from 'webpack';
|
||||||
import {
|
import {
|
||||||
ExecutorContext,
|
ExecutorContext,
|
||||||
joinPathFragments,
|
|
||||||
parseTargetString,
|
parseTargetString,
|
||||||
readTargetOptions,
|
readTargetOptions,
|
||||||
} from '@nrwl/devkit';
|
} from '@nrwl/devkit';
|
||||||
@ -51,6 +50,23 @@ export default async function* devServerExecutor(
|
|||||||
context.root,
|
context.root,
|
||||||
sourceRoot
|
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(
|
let webpackConfig = getDevServerConfig(
|
||||||
context.root,
|
context.root,
|
||||||
projectRoot,
|
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(
|
return yield* eachValueFrom(
|
||||||
runWebpackDevServer(webpackConfig, webpack, WebpackDevServer).pipe(
|
runWebpackDevServer(webpackConfig, webpack, WebpackDevServer).pipe(
|
||||||
tap(({ stats }) => {
|
tap(({ stats }) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user