Skip to content

Commit 4e97d8e

Browse files
authored
fix(angular-rspack): fix assets normalization (#39)
1 parent b50e063 commit 4e97d8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: packages/angular-rspack/src/lib/models/normalize-options.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FileReplacement } from '@nx/angular-rspack-compiler';
22
import {
33
normalizePath,
44
readCachedProjectGraph,
5+
workspaceRoot,
56
type ProjectGraphProjectNode,
67
} from '@nx/devkit';
78
import assert from 'node:assert';
@@ -375,8 +376,9 @@ function normalizeAssetPatterns(
375376
}
376377

377378
// When sourceRoot is not available, we default to ${projectRoot}/src.
378-
const sourceRoot = projectSourceRoot || join(projectRoot, 'src');
379-
const resolvedSourceRoot = resolve(root, sourceRoot);
379+
const resolvedSourceRoot = projectSourceRoot
380+
? join(workspaceRoot, projectSourceRoot)
381+
: join(workspaceRoot, projectRoot, 'src');
380382

381383
return assets.map((assetPattern) => {
382384
// Normalize string asset patterns to objects.

0 commit comments

Comments
 (0)