Skip to content

Commit 2f18571

Browse files
committed
refactor: update application builder entry points to property treat bare strings as module specifiers
Previously an entry point `foo` would be incorrectly treated as a relative path, which meant it was not possible to use an NPM package as an entry point. This now requires `./foo` for relative paths while `foo` is treated as a module specifier referring to an NPM package called `foo`.
1 parent 5fd0e4b commit 2f18571

File tree

1 file changed

+3
-4
lines changed
  • packages/angular_devkit/build_angular/src/builders/application

1 file changed

+3
-4
lines changed

packages/angular_devkit/build_angular/src/builders/application/options.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,9 @@ function normalizeEntryPoints(
417417
? parsedEntryPoint.name
418418
: path.join(parsedEntryPoint.dir, parsedEntryPoint.name);
419419

420-
// Get the full file path to the entry point input.
421-
const entryPointPath = path.isAbsolute(entryPoint)
422-
? entryPoint
423-
: path.join(workspaceRoot, entryPoint);
420+
// Get the full file path to a relative entry point input. Leave bare specifiers alone so they are resolved as modules.
421+
const isRelativePath = entryPoint.startsWith('.');
422+
const entryPointPath = isRelativePath ? path.join(workspaceRoot, entryPoint) : entryPoint;
424423

425424
// Check for conflicts with previous entry points.
426425
const existingEntryPointPath = entryPointPaths[entryPointName];

0 commit comments

Comments
 (0)