Skip to content

Commit

Permalink
fix(rspack): buildLibsFromSource option (#28994)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, the `buildLibsFromSource` option is not being used. So even
if the user sets it to `'buildLibsFromSource': false` it will not be
updated.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `buildLibsFromSource` should be supported.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
There is an issue with Rspack that requires the baseUrl to be set in the
generated tsconfig.

Fixes #
  • Loading branch information
ndcunningham authored Nov 19, 2024
1 parent 8c66662 commit 2c53e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/rspack/src/plugins/utils/apply-base-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
SwcJsMinimizerRspackPlugin,
CopyRspackPlugin,
RspackOptionsNormalized,
type DevTool,
} from '@rspack/core';
import { getRootTsConfigPath } from '@nx/js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class NxTsconfigPathsRspackPlugin {
apply(compiler: Compiler): void {
// TODO(Colum): Investigate the best way to handle this, currently it is not working and affecting HMR
// // If we are not building libs from source, we need to remap paths so tsconfig may be updated.
// this.handleBuildLibsFromSource(compiler.options, this.options);
this.handleBuildLibsFromSource(compiler.options, this.options);

const pathToTsconfig = !path.isAbsolute(this.options.tsConfig)
? path.join(workspaceRoot, this.options.tsConfig)
Expand Down Expand Up @@ -75,7 +75,8 @@ export class NxTsconfigPathsRspackPlugin {
options.tsConfig,
options.root,
target.data.root,
dependencies
dependencies,
true // There is an issue with Rspack that requires the baseUrl to be set in the generated tsconfig
);
this.tmpTsConfigPath = options.tsConfig;

Expand Down

0 comments on commit 2c53e74

Please sign in to comment.